I tried using ps r > log | wc log but this returns Ambiguous output redirect..
Can someone explain why and provide another solution?
|
|
||||
|
The pipe symbol ("|") redirects the output of one program to the input of another. You however use ">" to redirect So, you want one of the following (Hint: the latter solution is better as it doesn't create extra files.)
or
BTW: you might want |
||||
|
|
|
You are mixing redirection and piping
What you want is
If you wanted to use your methodology, then you would need to do the following
meaning, |
||||
|
|
|
Using
|
||||
|
|
|you could use&&that should work. – delh Nov 22 '12 at 12:10/proc/loadavgshould also include the number of running processes, btw. – sr_ Nov 22 '12 at 12:46