Redirecting stderr to stdout when piping

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

 



I know when redirecting output to a file you can do 2&1> to redirect stderr to stdout. But how would I redirect when want to pipe?

For example:
To also let this command mail the error messages:
# /usr/bin/php -q -f /var/www/galvatrack/sync/unispeqs2mysql.php | /usr/sbin/sendmail jan@xxxxxxxxx

I had to change it like this

# /usr/bin/php -q -f /var/www/galvatrack/sync/unispeqs2mysql.php &> /var/www/galvatrack/sync/lasttime.log; cat /var/www/galvatrack/sync/lasttime.log | /usr/sbin/sendmail my@xxxxxxxxxxx

But that just look horrible

--
for some how-to's and rpms visit my site    : http://solid.bounceme.net
for commercially supported solutions visit  : http://www.robas.com


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux