[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: executable scripts and arguments

From: David Grundberg
Subject: Re: executable scripts and arguments
Date: Mon, 08 Feb 2010 14:52:51 +0100
User-agent: Thunderbird (X11/20090812)

Dupuis wrote:

I'm "hit" by the "shebang" expansion problem as explained at, that is, I created
a stand alone octave script with as first line
#!/usr/bin/octave --no-init-file --persist
The problem is that the program is called with
argv[0] = /usr/bin/octave
argv[1] = "--no-init-file --persist"
argv[2] =  the name of the script
This way, octave returns an error message because it doesn't understand
argv[1], which results from the concatenation of the two intended args. Did
someone already succeed in avoiding this problem ?



There is a limitation in how shebang interpretation works, like you discovered. This is documented in the Octave manual:

You can supply only one argument in the shebang, the 2nd argument is the interpreter file. Unfortunately neither --no-init-file or --persist has short option flags. One solution would be to write a wrapper that adds these arguments.

Either that or use

#!/usr/bin/octave -f

and add a 'keyboard' call at the end of the script.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]