Hi, The correct way of doing it for a String argument is using eche ' ' passing the string directly as below
spark-shell -i <(echo 'val ticker = "tsco"' ; cat stock.scala) Dr Mich Talebzadeh LinkedIn * https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw <https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>* http://talebzadehmich.wordpress.com *Disclaimer:* Use it at your own risk. Any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on this email's technical content is explicitly disclaimed. The author will in no case be liable for any monetary damages arising from such loss, damage or destruction. On 25 October 2016 at 11:23, Mich Talebzadeh <mich.talebza...@gmail.com> wrote: > Hi guys, > > Besides using shell parameters is there anyway of passing a parameter to > Spark-shell like in Zeppelin > > val ticker = z.input("Ticker to analyze? default MSFT", "msft").toString > > I gather this can be done in Spark shell > > export TICKER="msft" > spark-shell -i <(echo val ticker = $TICKER ; cat <file-name>) > > > as describe here > <http://stackoverflow.com/questions/29928999/passing-command-line-arguments-to-spark-shell> > > > Thanks > > > > > Dr Mich Talebzadeh > > > > LinkedIn * > https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw > <https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>* > > > > http://talebzadehmich.wordpress.com > > > *Disclaimer:* Use it at your own risk. Any and all responsibility for any > loss, damage or destruction of data or any other property which may arise > from relying on this email's technical content is explicitly disclaimed. > The author will in no case be liable for any monetary damages arising from > such loss, damage or destruction. > > >