[clug] bash stderr and not-so-stderr?

Jeremy Kerr jk at ozlabs.org
Mon Nov 24 08:31:22 GMT 2008


Hi David,

> The problematic line looks something like:
>     /usr/bin/rdiff-backup $from $to 2>&1 >> $MAILFILE || exit 1
>
> I've simplified that line slightly for this post but it has the same
> problem.

You need to redirect stderr to stdout *after* you've redirected stdout:

  /usr/bin/rdiff-backup $from $to >>$MAILFILE 2>&1

Cheers,


Jeremy


More information about the linux mailing list