Re: When running from a script execlineb does not use separated args

2018-07-30 Thread Colin Booth
On Mon, Jul 30, 2018 at 10:44:36PM -0500, Joshua Haase wrote:
> Using a script fails when using with the headers:
> 
> #!/bin/execlineb -W -S1
> 
> or
> 
> #!/bin/execlineb -W -S 1
> 
> I guess it's because when the commands are executed, the second part is
> treated as a single arg, so execlineb receives
> 
> execlineb '-W -S1' and thus fails to interpret that as options.
> 
You're running into an unfortunate side effect of shebang lines where
only the first argument is available.
> 
> $ execlineb '-W -S1' 'echo ${@}'
> execlineb: usage: execlineb [ -p | -P | -S nmin | -s nmin ] [ -q | -w | 
> -W ] [ -c commandline ] script args
> $ execlineb '-W -S1' 'echo ${@}' pato
> execlineb: usage: execlineb [ -p | -P | -S nmin | -s nmin ] [ -q | -w | 
> -W ] [ -c commandline ] script args
> 
> Should something be done about that problem?
> 
> Document that perk, maybe?
Unfortumately this is impossible to fix short of redoing the shebang
interpretation in Unix. You should be able to see similar behavior in
shell scripts by setting #!/bin/sh -e -x as your shebang (or something
similar).

-- 
Colin Booth


When running from a script execlineb does not use separated args

2018-07-30 Thread Joshua Haase
Using a script fails when using with the headers:

#!/bin/execlineb -W -S1

or

#!/bin/execlineb -W -S 1

I guess it's because when the commands are executed, the second part is
treated as a single arg, so execlineb receives

execlineb '-W -S1' and thus fails to interpret that as options.


$ execlineb '-W -S1' 'echo ${@}'
execlineb: usage: execlineb [ -p | -P | -S nmin | -s nmin ] [ -q | -w | -W 
] [ -c commandline ] script args
$ execlineb '-W -S1' 'echo ${@}' pato
execlineb: usage: execlineb [ -p | -P | -S nmin | -s nmin ] [ -q | -w | -W 
] [ -c commandline ] script args

Should something be done about that problem?

Document that perk, maybe?