Re: ash - exit code for a piped process

2007-08-04 Thread Tito
On Saturday 04 August 2007 15:45:56 Loïc Grenié wrote: > 2007/8/4, Alexander Kriegisch <[EMAIL PROTECTED]>: > > I would like to determine the exit code of 'foo' in > > foo | bar > > > > I bash there is the PIPESTATUS array, but in ash (which I must use) > > there is no such thing as PIPESTATUS or a

Re: ash - exit code for a piped process

2007-08-04 Thread Alexander Kriegisch
> x=`((( foo 3>&- 4>&- ); echo $? >&3)| bar >&4 3>&- 4>&-) 3>&1` 4>&1 Thanks, Loïc. I will consider your solution if I ever have a case like this again, but my current workaround is rather simple to read and uses a text buffer for the first command's output. I can do this because I know that foo'

Re: ash - exit code for a piped process

2007-08-04 Thread Loïc Grenié
2007/8/4, Alexander Kriegisch <[EMAIL PROTECTED]>: > I would like to determine the exit code of 'foo' in > foo | bar > > I bash there is the PIPESTATUS array, but in ash (which I must use) > there is no such thing as PIPESTATUS or arrays. Is there any canonical > way or at least a workaround to ach

ash - exit code for a piped process

2007-08-04 Thread Alexander Kriegisch
I would like to determine the exit code of 'foo' in foo | bar I bash there is the PIPESTATUS array, but in ash (which I must use) there is no such thing as PIPESTATUS or arrays. Is there any canonical way or at least a workaround to achieve both piping the foo's output into bar unconditionally *an