[wplug] very simple bash question..

Tom Rhodes trhodes at FreeBSD.org
Wed Mar 23 08:51:08 EST 2005


On Tue, 22 Mar 2005 11:44:59 -0500
Tim Lesher <tim at lesher.ws> wrote:

> On Thu, Mar 17, 2005 at 09:32:42AM -0500, Eric Cooper wrote:
> > or: var=$(ps aux | wc -l)
> 
> Cool! Thirteen years with UNIX, and I'm still learning new tricks.
> 
> Is this a bashism, or does it work with sh proper?  (I don't have my
> bsd laptop handy to check).

It should.  In all of my sh scripts, I usually use:

VAR=`... | ... | awk ' blah ' | ...`

Then access with
${VAR}

-- 
Tom Rhodes


More information about the wplug mailing list