[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cvs commit to debian-installer/tools/ddetect by pere

On Sun, Jul 27, 2003 at 10:50:45AM -0400, Joey Hess wrote:
> This is why we need some way to call logger in a shell script that does
> not discard return code. I think it can be done using a nasty shell
> function that redirects to a file, but I hope there is a better way, and
> someone is apparently working on something in C that preserves return
> codes while logging output. Probably something along the lines of:
> /usr/bin/log_output 'shell command here'

How about some variant on:

  ((echo hello world; false; echo $? >&3) | logger) 3>&1

... and then look at the output?


Colin Watson                                  [cjwatson@flatline.org.uk]

Reply to: