[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: return values of bash scripts

From: Mike Frysinger
Subject: Re: return values of bash scripts
Date: Tue, 20 Dec 2011 19:06:10 -0500
User-agent: KMail/1.13.7 (Linux/3.1.0-atsc; KDE/4.6.5; x86_64; ; )

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 your own script named "crond.sh"

make the awk script smarter, or use pgrep

Attachment: signature.asc
Description: This is a digitally signed message part.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]