use of #!/usr/bin/env octave with optargs ?

View: New views
4 Messages — Rating Filter:   Alert me  

use of #!/usr/bin/env octave with optargs ?

by Eric Chassande-Mottin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


hi,

I'd like to run a script with the following shebang line
#!/usr/bin/env octave -q

but I get an error
/usr/bin/env: octave -q: No such file or directory

an old thread says there are no solution
http://www.nabble.com/octave-shebang-td394305.html#a394305

just wondering if this is still the case.

cheers,
eric

Re: use of #!/usr/bin/env octave with optargs ?

by Søren Hauberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Quoting Eric Chassande-Mottin <echassandemottin@...>:

> I'd like to run a script with the following shebang line
> #!/usr/bin/env octave -q
>
> but I get an error
> /usr/bin/env: octave -q: No such file or directory
>
> an old thread says there are no solution
> http://www.nabble.com/octave-shebang-td394305.html#a394305
>
> just wondering if this is still the case.

I don't think a solution has been presented, and apparently it isn't  
trivial to produce one (see  
http://en.wikipedia.org/wiki/Shebang_(Unix)#Portability). Perhaps  
octave should ship a simple program 'octave-q' that acts just like  
'octave' when called with the '-q' argument?

Søren


_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: use of #!/usr/bin/env octave with optargs ?

by Michael Creel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Sep 9, 2008 at 1:04 PM,  <soren@...> wrote:

> Quoting Eric Chassande-Mottin <echassandemottin@...>:
>> I'd like to run a script with the following shebang line
>> #!/usr/bin/env octave -q
>>
>> but I get an error
>> /usr/bin/env: octave -q: No such file or directory
>>
>> an old thread says there are no solution
>> http://www.nabble.com/octave-shebang-td394305.html#a394305
>>
>> just wondering if this is still the case.
>
> I don't think a solution has been presented, and apparently it isn't
> trivial to produce one (see
> http://en.wikipedia.org/wiki/Shebang_(Unix)#Portability). Perhaps
> octave should ship a simple program 'octave-q' that acts just like
> 'octave' when called with the '-q' argument?
>
> Søren
>
>
> _______________________________________________
> Help-octave mailing list
> Help-octave@...
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>

Hmm, on the current Kubuntu, the following works for me:

1) create a script "octave" in ~/bin/octave that contains

#!/bin/sh
/usr/local/bin/octave -q

2) make it executable, and make sure that ~/bin/ is before
/usr/local/bin in $PATH

Good enough for government work, no?

M.

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: use of #!/usr/bin/env octave with optargs ?

by Francesco Potortì :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>> I'd like to run a script with the following shebang line
>> #!/usr/bin/env octave -q
>>
>> but I get an error
>> /usr/bin/env: octave -q: No such file or directory
>>
>> an old thread says there are no solution

You can write a shell script and put it somewhere:

=============== /usr/local/bin/envoctaveq ==================
#! /bin/sh
exec /usr/bin/env /usr/bin/octave -q "$@"
============================================================

then use this as your first line:
#! /usr/local/bin/envoctaveq

I see that you do not use the -f option to Octave.  If this is
intentional or an oversight?  Generally speaking, you want 'octave -qf'
for invoking a script.

--
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: Potorti@...
(entrance 20, 1st floor, room C71)     Web:   http://fly.isti.cnr.it/
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave