Scala scripts in Windows batch files -



Scala scripts in Windows batch files -

in programming in scala, gives description on how run scala scripts batch files (link).

for windows

::#! @echo off phone call scala %0 %* goto :eof ::!#

i'm having problem googling ::#!. mean? know :: denotes comment , in unix #! direction shell used, here? , ::!#?

what %0 %* mean, , necessary express this?

is possible run multiple scripts same batch file?

this gimmick, works. intends replicate unix shell's ability invoke particular command process shell file. so, here's explanation:

::#!

lines starting :: comments in windows shell, comment.

@echo off

don't show lines executed here on. @ @ origin ensure line won't shown.

call scala %0 %*

transfer execution scala script. %0 means name of file (so scala can find it), , %* parameters passed in execution.

for example, these lines in file called count.bat, , invoked typing count 1 2 3. in case, line execute scala count 1 2 3 -- in case you'll error. must invoke typing count.bat.

goto :eof

finish executing script.

::!#

another comment line.

so, here's trick... scala, 1 time invoked, find file passed first argument, check if first line ::#!, ignore line ::!# if so, , execute rest of file (the lines after ::!#) scala script.

in other words, not windows shell smart, it's scala. :-)

windows scala scripting batch-file

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -