Re: return values of bash scripts

2011-12-21 Thread Stephane CHAZELAS
2011-12-20, 14:18(-08), kc123: [...] > Could someone please help me figure out why: > GNU bash, version 3.2.25(1)-release-(x86_64-redhat-linux-gnu) [...] Since you're using RedHat Linux, try ps -o comm= -C crond -- Stephane

Re: return values of bash scripts

2011-12-21 Thread kc123
Thanks Bob. Awesome! The matching string example below did the trick. Bob Proulx wrote: > > Mike Frysinger wrote: >> kc123 wrote: >> > For example, my script below called crond.sh: >> > ... >> > content=`ps auxw | grep [c]rond| awk '{print $11}'` >> > ... >> > and output is: >> > CONTENT: /bin/

Re: return values of bash scripts

2011-12-21 Thread Greg Wooledge
On Tue, Dec 20, 2011 at 02:18:16PM -0800, kc123 wrote: > content=`ps auxw | grep [c]rond| awk '{print $11}'` http://mywiki.wooledge.org/ProcessManagement > echo "CONTENT:" $content http://mywiki.wooledge.org/Quotes http://mywiki.wooledge.org/Arguments I would strongly advise that you state what

Re: return values of bash scripts

2011-12-20 Thread Bob Proulx
Mike Frysinger wrote: > kc123 wrote: > > For example, my script below called crond.sh: > > ... > > content=`ps auxw | grep [c]rond| awk '{print $11}'` > > ... > > and output is: > > CONTENT: /bin/bash /bin/bash crond > > > > Why are there 2 extra arguments printed (/bin/bash) ? > > because you gr

Re: return values of bash scripts

2011-12-20 Thread Mike Frysinger
On Tuesday 20 December 2011 17:18:16 kc123 wrote: > For example, my script below called crond.sh: > ... > content=`ps auxw | grep [c]rond| awk '{print $11}'` > ... > and output is: > CONTENT: /bin/bash /bin/bash crond > > Why are there 2 extra arguments printed (/bin/bash) ? because you grepped y