Bash Prompt HOWTO: $Revision: 0.100 $, $Date: 2009/08/07 02:33:22 $ | ||
---|---|---|
Prev | Chapter 10. Prompt Code Snippets | Next |
ps ax | wc -l | tr -d " " OR ps ax | wc -l | awk '{print $1}' OR ps ax | wc -l | sed -e "s: ::g". In each case, tr or awk or sed is used to remove the undesirable whitespace.
Relative speed: the tr variant takes about 0.105 seconds on an unloaded 800 MHz Celeron with 100 processes. The others take very similar times.