|
I'm trying to run vscript with -e to execute a script snippet, and then exit. But I would like to pass arguments to the the snippet. I know this is a weird request because I can just embed the arguments into the snippet, but I'm trying to keep the snippet text constant and small, as the argument values can be a bit longer. If I do this: vscript -e "print(arguments[0])" hello I get: undefined can't open hello: No such file or directory If I do this: vscript -e "print(arguments[0])" helloI get: hello can't open a: No such file or directory Which is close, but I don't want that error (it is obviously trying to take the first argument as a script filename to execute, but I don't have a file to execute). If I make the first argument "-" it runs the snippet and then drops to the interactive prompt. Which is also undesirable. Adding "quit();" to the end of my snippet doesn't change anything. |
|
The only way to get parameters into the So if your script first creates an empty, or full-of-blanks
and you'll see
as you hope. |