Re: Redirecting stderr to stdout when piping

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

 



On Wed, 2005-08-17 at 09:29 +0200, StarQuake wrote:
> 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

php -q -f /var/..blah../unispeqs2mysql.php 2>&1 | /usr/sbin/sendmail ...

Paul.
-- 
Paul Howarth <paul@xxxxxxxxxxxx>


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

  Powered by Linux