Re: backtick to NOT set variable

2016-06-20 Thread Laurent Bercot
On 21/06/2016 02:39, Guillermo wrote: Does for me, both programs. However, backtick's documentation doesn't mention now that the -i, -I and -D options also affect the behaviour and exit status when 'prog1' (the one that runs as a child) crashes or exits 0. Not sure if there are other failure mode

Re: backtick to NOT set variable

2016-06-20 Thread Guillermo
2016-06-18 15:13 GMT-03:00 Laurent Bercot: > > Please try the -I option to backtick and withstdinas > in the latest execline git and tell me if it works for you. Does for me, both programs. However, backtick's documentation doesn't mention now that the -i, -I and -D options also affect the behavio

Re: backtick to NOT set variable

2016-06-18 Thread Laurent Bercot
Sorry it took so long. Please try the -I option to backtick and withstdinas in the latest execline git and tell me if it works for you. -- Laurent

Re: backtick to NOT set variable

2016-05-20 Thread Laurent Bercot
On 20/05/2016 18:44, Max Ivanov wrote: Pretty much yes. Don't set ENV variable to the output value of a prog if prog exited with anything but 0 (== that is what I call error, but commands in execline make distinction between error codes and "exit due to signal", so backtick might need to do it to

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: backtick to NOT set variable

2016-05-20 Thread Laurent Bercot
On 18/05/2016 13:42, Max Ivanov wrote: can backtick (or combination of other scripts commands) can be to NOT set env var on error? I'm pretty sure that any case can be achieved with the current behaviour, but I agree that ugly contorsions are necessary for more than one case, so I'm ok to add

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: backtick to NOT set variable

2016-05-18 Thread Laurent Bercot
On 18/05/2016 13:42, Max Ivanov wrote: can backtick (or combination of other scripts commands) can be to NOT set env var on error? 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. backtick -n MAYBE_AR

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.