Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Just a related trick' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Just a related trick
Authored by: tom_b on Jun 30, '07 02:33:53PM
ps -axwwo command | grep [l]ame > ~/Desktop/lame_command.txt

As the brackets are controlled by the shell you won't need to filter by the previous grep.

The brackets in the pattern '[l]ame' are not controlled by the shell, instead they're passed to grep which expects a list of characters between the brackets any of which will match (in this case just 'l').

It still achieves the same effect because as a pattern '[l]ame' will match the string 'lame' but not the string '[l]ame'.

That's probably more confusing than helpful - sorry! It is a neat trick.

[ Reply to This | # ]