Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
-
kanen
- Posts: 145
- Joined: Thu Mar 25, 2010 6:24 pm
-
Contact:
Post
by kanen »
I should be able to specify command-line options to be used with (main-args)
Code: Select all
$ newlisp -word hi
ERR: no working directory found
This is a problem, because I did not specify "-w <working directory>" -- even though newLisp believes I did.
Maybe check for a space after -w?
-
Lutz
- Posts: 5289
- Joined: Thu Sep 26, 2002 4:45 pm
- Location: Pasadena, California
-
Contact:
Post
by Lutz »
You can specify your own options after the script name and they will not be confused with newLISP options:
Code: Select all
[newlisp /home/public]$ newlisp test -word -lol
=>("newlisp" "test" "-word" "-lol")
[newlisp /home/public]$
or as a shell script:
Code: Select all
[newlisp /home/public]$ ./test -word -lol
=>("/home/public/cgi-bin/newlisp" "./test" "-word" "-lol")
[newlisp /home/public]$
don't forget an (exit) statement at the end of your script, or newLISP will try to process the options meant to be for the script:
Code: Select all
#!/home/public/cgi-bin/newlisp
(println "=>" (main-args))
(exit) ; important
ps: when using the -w option for newLISP, it should not be followed by a script, except when you adjust the path to the script accordingly