backtick to NOT set variable

2016-05-18 Thread Max Ivanov
Hi, can backtick (or combination of other scripts commands) can be to NOT set env var on error? here is a toy example: #!./bin/execlineb -S0 backtick -n MAYBE_ARG { /bin/false } import -u MAYBE_ARG s6-echo ${MAYBE_ARG} $@ when running under strace I see that it passes empty arg "" to command.

Re: backtick to NOT set variable

2016-05-18 Thread Max Ivanov
> > Not if it succeeds. > However, backtick -i will exit on error: you can use that difference in > program flow to create the sequence you need. I didn't find a construct where rest of the program can be executed in same process as `backtick`, or at least forked after `backtick`. Closest I coul

Re: udevd log

2016-05-20 Thread Max Ivanov
Is your log run file actually in `udevd/log/run` ? also worth checking with ps that you actually have `s6-log` process running, because you log script will fail if there is no 's6log' user in the system On 20 May 2016 at 14:07, Eric Vidal wrote: > Hello, > > I try to have log about udevd. this

printf '%q ' "$@" alternative?

2016-05-20 Thread Max Ivanov
Hi All, How could I correctly save $@ in a file for a future execution?

Documentation feedback: surprising behavior of null substitutes

2016-05-20 Thread Max Ivanov
Docs on 'importas' specify that missing env var without a default value would produce a "null arg", however nowhere else term "null arg" is used or described (including very important "el_substitute" document), which lead to a surprising result at least for me: ``` emptyenv -p import -u VAR s6-ech

Re: printf '%q ' "$@" alternative?

2016-05-20 Thread Max Ivanov
Can't see how it can help, am I missing something? Expected result is 2 arguments passed: ``` ./execlineb -c 'strace -etrace=execve ./s6-echo 1 "A B"' execve("./s6-echo", ["./s6-echo", "1", "A B"], [/* 102 vars */]) = 0 ``` What I actually get with dollarat: ``` echo "strace -etrace=execve ./s6-e

Re: Documentation feedback: surprising behavior of null substitutes

2016-05-20 Thread Max Ivanov
> Documentation for the -D option to importas: "If envvar is undefined, > and this option is not given, substitute zero word for variable instead > of the empty word". Few lines above: "If neither the -D nor the -i option is given, and envvar is undefined, the null word is returned." so it uses

Re: Documentation feedback: surprising behavior of null substitutes

2016-05-20 Thread Max Ivanov
cot wrote: > On 20/05/2016 18:09, Max Ivanov wrote: >> >> so it uses "zero word" and "null word" interchangeably, which doesn't >> help either :) "zero word" seems closer to "empty word" (==no >> magic,just ''), than

Re: backtick to NOT set variable

2016-05-20 Thread Max Ivanov
> What exactly is the behaviour you want: > > - don't exit on error, just keep exec'ing >+ do you just define "error" as the subprocess exiting anything else > than 0 ? > - but completely undefine the variable, in order for later tests such > as importas to pick that up? > > Is that right,

Re: printf '%q ' "$@" alternative?

2016-05-20 Thread Max Ivanov
> You're missing the -0 option, or the -d "" option. ;) Can't wrap my head around it, calling for help. So I have a /tmp/script: ``` #!/bin/execlineb -S0 if { redirfd -w 1 /tmp/runme s6-echo $@ } execlineb /tmp/runme ``` Which I call like this: ``` /tmp/script strace -etrace=execve s6-echo A "

"ifthen" for more "dynamic" argv manipulation

2016-05-24 Thread Max Ivanov
Hi, I'd like to discuss an idea of more dynamic argv manipulation. Since execline heavily relies on chain loading it becomes very important whether block is executed directly or via fork; add to that extreme importance of ENV vars as a way to carry state through chain loading and it becomes extre

Re: "ifthen" for more "dynamic" argv manipulation

2016-05-24 Thread Max Ivanov
Thanks for crystal clear response and for keeping design clean, while not forgetting about practical aspects of real-life use-cases. `-s` switch is what I wanted indeed. Strangely, despite writing in execline more or less for a week, concept that "nothing leaks from a block" never crossed my mind

Re: Execlineb scripts on systems with conflicting binaries

2016-05-27 Thread Max Ivanov
Just reorder dirs in your PATH env var. They are scanned from left to right.