View Single Post

   
  #2 (permalink)  
Old 01-12-2008, 05:52 AM
 
Posts: n/a
Default Re: time command usage

In article <799fe45f.0311130821.2810930e@posting.google.com >,
demone33@yahoo.it (Sara) writes:
> OS: SOlaris 8
>
> I am monitoring my system to periodically check network performance
> (e.g. DNS lookup) using a script like this:
> while true;
> do
> echo $(date) >> $OUTPUT_FILE
> time nslookup www.sun.com | grep real >> $OUTPUT_FILE
> sleep 30
> done
> but the grep and the output redirections does not seem to work? Any
> suggestion (I am not very familiar with the 'time' command).


Then read the man page on time.
Note:
-p Writes the timing output to standard error in the following format:
^^^^^^^^^^^^^^

Also your shell may override "time" with its own builtin version..

Try: /usr/bin/time -p nslookup www.sun.com 2>&1 etc.
Reply With Quote