So there are several things.
- "=" is not a legit envvar name: envvar names cannot include a '='
character. "!" is absolutely a legit envvar name, though, and execline
uses it with commands such as background or pipeline.
- execline does not understand single quotes. '!' will translate
As other people said, using "if" instead of "foreground" is the
idiomatic way to exit on child error. I myself am a staunch
"#!/bin/sh -e" user, and almost never use "foreground" in execline
scripts - only when I specifically need the exit code of some command.
Forwarding signals to a child
The point is correct; using if instead of foreground sounds like what is wanted
here
(Though in this case the rest of the script wouldn’t run in the data directory;
besides,`execline-cd data [etc]` would just error out immediately.)
Perhaps just wrap each preparation command in an if block?
if { execline-cd data }
Will continue the script if execline-cd succeeds, and abort if it does not.
On Mon, Sep 5, 2022, 1:54 PM Saj Goonatilleke via skaware <
skaware@list.skarnet.org> wrote:
> Hello,
>
> Within the context of, say,
On 9/5/22 22:15, alice wrote:
On Mon Sep 5, 2022 at 10:08 PM CEST, Songbo Wang wrote:
#!/usr/bin/execlineb -P
export ! 0
s6-test -v '\!'
changing this to
s6-test -v \\\!
works as expected.
Thanks for the reply. It indeed works. But there is one thing I find
counter-intuitive: s6-test
When the environment modification takes place with export is unintuitive; try
```
#!/usr/bin/execlineb -P
export ! 0
foreground { exit }
s6-test -v '\!'
```
On Mon Sep 5, 2022 at 10:08 PM CEST, Songbo Wang wrote:
> On 9/5/22 20:57, alice wrote
> > s6-test -v '\!'
> > seems to work for me, tested with
> > env !=1 s6-test -v'\!'
> > and without the env. maybe i'm misreading it?
> >
> Your example works for me on bash, but I just tested by the
On 9/5/22 20:57, alice wrote
> s6-test -v '\!'
> seems to work for me, tested with
> env !=1 s6-test -v'\!'
> and without the env. maybe i'm misreading it?
>
Your example works for me on bash, but I just tested by the following
execline script
#!/usr/bin/execlineb -P
exec -c s6-test -v !
On Mon Sep 5, 2022 at 8:42 PM CEST, Songbo Wang wrote:
> Hi,
>
> I've been recently playing with execline scripts and found out that
> s6-test -v !
s6-test -v '\!'
seems to work for me, tested with
env !=1 s6-test -v'\!'
and without the env. maybe i'm misreading it?
> is not able to test if the !
Hello,
Within the context of, say, an s6 run script that needs to do a little bit of
prep work before execing into a server, it is often helpful to abort early if
any of said prep work stumbles upon an unexpected problem.
Maybe the filesystem is R/O. Or full.
Maybe an operator has fat-fingered
Hi,
I've been recently playing with execline scripts and found out that
s6-test -v !
is not able to test if the ! environment variable is set. I guess it is
because s6-test would also need to handle expressions like "x != y", but
the code is too mystic for me to understand (by the way, s6-test
11 matches
Mail list logo