[wplug] very simple bash question..

Eric Cooper ecc at cmu.edu
Thu Mar 17 09:32:42 EST 2005


On Thu, Mar 17, 2005 at 09:21:35AM -0500, Chris Romano wrote:
> On Thu, 17 Mar 2005 09:18:54 -0500, Mike <techmike at gmail.com> wrote:
> > How would I store a programs output to a variable?
> > 
> > I want to take the output of
> > 
> > ps aux | wc -l
> > 
> > and store it so I can do some math with it.
> 
> var=`ps aux | wc -l`
> 
> make sure there are no spaces between the "="

or: var=$(ps aux | wc -l)

This form is useful because it nests, unlike the backticks.
	
-- 
Eric Cooper             e c c @ c m u . e d u


More information about the wplug mailing list