Re: How to write an execline helper in execline?

From: Olivier Brunel <jjk_at_jjacky.com>
Date: Sun, 16 Oct 2016 17:47:01 +0200

On Sun, 16 Oct 2016 14:56:14 +0000
"Laurent Bercot" <ska-skaware_at_skarnet.org> wrote:

> >So, please enlighten me if I'm missing a better solution, of course,
> >but in case I'm not, I was wondering how you'd feel about adding a
> >new option to execlineb, e.g. -s, that would require a number as arg
> >(much like -S) but would work as such:
> Still considering your -s idea, which should be easy enough to
> implement once I remember how execlineb does things :) but in the
> meantime, wouldn't the "runblock" command help you? Something like
>
> #!/command/execlineb
> importas FIRSTARG 1
> # work with $FIRSTARG
> runblock -n 1 -r -- 0

Well, that still involves the environment, which I'd like to skip
altogether, but it does seem a bit "easier" since the runblock
call replaces shift+elgetpositionals+emptyenv; However, this gives me
"odd" results.

Consider your script above as ./helper :

$ ./helper foo bar baz
runblock: fatal: unable to exec bar: No such file or directory

Yep, makes sense. Now trying this:

$ ./helper foo bar

Nothing. It ran the helper, then didn't (try to) exec into bar.
Now let's try this:

$ ./helper foo

and it segfaults! (So does "./helper" btw) So maybe "./helper foo
bar" should actually work, but doesn't because of the same bug that
causes segfault?
Received on Sun Oct 16 2016 - 15:47:01 UTC

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