Re: redirecting time output

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



Rainer Traut wrote:
> Hi,
>
> am trying to pipe output from time command and output from a shell
> script to the mail program.
> So far it's not working as expected...
>
> # time echo "test" 2>&1 | mail -s "timetest" my@xxxxxxxx
>
> real    0m0.126s
> user    0m0.000s
> sys     0m0.000s
>
> The time command writes to stderror, but here the redirection seems to
> apply to the echo command?

Try `time echo "test"` etc. That way, it executes in a subshell, and has
one STDOUT and STDERR.

        mark

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux