I am writing a bash script, and on a condition I'd like to output ps aux --sort -rss
However, when I write :
echo `ps aux --sort -rss`
everything is on one huge line. How do I run it so it outputs like it normally does in a terminal?
|
Quote the command:
Otherwise bash just parses the tokens, ignoring whitespace including newlines like it does when you type it by hand. |
|||||||||||||||||||
|
ps aux --sort -rss? – Michael Mrozek♦ Nov 18 '11 at 19:09echo, somebody did submit that as an answer – Michael Mrozek♦ Nov 18 '11 at 20:32