Hi ..When I run this command netstat -t 1 -i 2>&1 > $NETStat_OUT_FILE &
inside a script , the output of netstat does not get redirected to the file.. Could any one find a solution for this ?
views:
34answers:
1
A:
You need to redirect stdout first, then stderr.
netstat -t 1 -i > $NETStat_OUT_FILE 2>&1 &
Dennis Williamson
2010-04-27 19:29:58
sorry.. there is no problem as such..but when i try to read the output file immediately after execution it puts out a blank file.. the redirection program takes time to write the output onto the output file..i'm able to view the output if i open it after sometime
Sharat Chandra
2010-04-27 20:28:22
@Sharat: What is the time taken by command to give output if you are not redirecting it?
Space
2010-04-28 04:08:42
it is instantaneous ,if you are not redirecting
Sharat Chandra
2010-04-28 14:53:09