Date: Mon, 24 Jun 2002 10:46:00 -0500 From: C Peter Biessener <pbiessener@hirshfields.com> To: FreeBSD Questions <freebsd-questions@freebsd.org> Subject: Bourne shell question Message-ID: <3D173EB8.2040503@hirshfields.com>
next in thread | raw e-mail | index | archive | help
I have a program which may be run interactively or via cron. I want to use one shell wrapper for both instances. <--- fragment ---> if [ $interactive -eq $TRUE ]; then # myprog $interactive_args 2>&1 | tee -a $err_file myprog $interactive_args else myprog $cron_args >>$err_file 2>&1 fi if [ $? -ne 0 ]; then # do error processing . . . fi <--- fragment ---> I want my interactive users to see any errors (so they know if it failed), but ideally I would also like to capture the errors to an error file as well. However, if I use 'tee', then $? gets tee's exit value and not the exit value from myprog. Is there any way to be able to do what I want? Thanks, Peter Biessener To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D173EB8.2040503>