This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Where does the 'time' (shell keyword) write?


On Thu, 16 Oct 2003, Alex Vinokur wrote:

> $ type time
> time is a shell keyword
>
>
> $ time ls
> dummy1  dummy2
>
> real    0m0.040s
> user    0m0.020s
> sys     0m0.040s
>
>
> $ time ls > zzz
>
> real    0m0.040s
> user    0m0.020s
> sys     0m0.040s
> // So, 'time' doesn't write to stdin (?!)
>
>
> $ time ls 2> zzz2
> dummy1  dummy2  zzz
>
> real    0m0.040s
> user    0m0.020s
> sys     0m0.030s
> // So, 'time' doesn't write to stderr (?!)
>
>
> Question-1. Where does the 'time' (shell keyword) write?

stderr, but any redirection will be attributed to the command, not the
keyword.

> Question-2. How to redirect output of the 'time' (shell keyword)?

(time ls) 2> zzz2

HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]