Re: bash < execline > bash

From: Eric Vidal <eric_at_obarun.org>
Date: Sun, 1 May 2016 14:26:37 +0400

On Sun, 1 May 2016 01:00:11 -0700
Colin Booth <cathexis_at_gmail.com> wrote:

> On Sat, Apr 30, 2016 at 10:45 PM, Eric Vidal <eric_at_obarun.org> wrote:
> > It is possible to have a zsh/bash and execlineb syntax on the same file?
> With some work yes. By default any execline script plays nice with
> interstitial programs that only do chain loading. So programs like
> nice, time, etc are all fine. It does not play nice with programs that
> terminate, however it provides the foreground and background programs
> to handle that.

understood

> > For example :
> > #!/bin/execlineb -P
> >
> > if [ -d /run/example ]; then
> > s6-mkdir -m 0755 /run/example
> > fi
> Not an execline script, this is pure shell with an alternate mkdir
> implementation. Using the execline interpreter is wrong here.
> >
> > or
> >
> > #!/bin/execlineb -P
> >
> > if { s6-test -d /run/example }
> > mkdir -m 0755 /run/example
> This is fine. The execline if program chain loads into the next
> program if its test passes, and while mkdir (and s6-mkdir) are not
> chain loading programs, as long as it is the last program in the
> script it doesn't matter. If you wanted to have the script do more
> work after the mkdir, you would need to rewrite your script as
> follows:
> #!/bin/execlineb -P
> if {s6-test -d /run/example }
> foreground { mkdir -m 0755 /run/example }
> rest_of_program
>
> foreground is used to wrap a normal, terminating program with one that
> understands how to exec and is commonly used when a discrete one-shot
> program is needed within an execline program.

great thank for your explanation

One more question, my knowledge is not sufficient to understand this following command :
unexport ?
i'm not understand the ? here
or
unexport !
the last one unexport the shebang/interpreter variable or my thought is on totally wrong way?
Can you explain me please?

Regards


-- 
Eric Vidal <eric_at_obarun.org>
Received on Sun May 01 2016 - 10:26:37 UTC

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