vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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). |
| |||
| 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. |
| |||
| Sara wrote: > 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). For Bourne; ( time nslookup www.sun.com ) 2>&1 | grep real HTH Gary |
| ||||
| gerryt@gtconnect.net wrote: > 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. Or even better, use ptime which uses microstate accounting so gives a far more accurate result. Scott |