Re: execline-in-execline

From: Guillaume Perréal <gperreal_at_free.fr>
Date: Thu, 7 Jun 2018 18:32:41 +0200

As a matter of example : this scripts "rewrites" its final command
depending on optional arguments. Its purpose is to restore select parts
of the environment variables, uid/gid and working directory, that were
saved in a directory at some point in the past.

https://github.com/Adirelle/s6rc-overlay/blob/master/src/sbin/with-contenv

Maybe it is pushing execline a bit too far but I didn't fell like coding
it in C (which I do no master).

Le 07/06/2018 à 17:59, Profpatsch a écrit :
> Laurent Bercot writes:
>
>> Remember that once an execlineb script has been parsed, it's just a
>> command line, no more, no less. So your example script can just be
>> written as:
>>
>> #!execline
>> define url example.com
>> s6-tcpclient $url 80
>> foreground { fdmove 1 7 echo -en "..." }
>> fdmove 0 6 cat
>>
>> No second execlineb invocation necessary at all. No quoting
>> nightmares.
> Ooooooh, you are right!
> It’s even more elegant than I thought!
> Nice.
>
Received on Thu Jun 07 2018 - 16:32:41 UTC

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