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

From: Colin Booth <colin_at_heliocat.net>
Date: Tue, 31 Jul 2018 04:21:35 +0000

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 ${_at_}'
> execlineb: usage: execlineb [ -p | -P | -S nmin | -s nmin ] [ -q | -w | -W ] [ -c commandline ] script args
> $ execlineb '-W -S1' 'echo ${_at_}' 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
Received on Tue Jul 31 2018 - 04:21:35 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC