Programming and Scripting :: Simple shell-based daemon



I think he wants to _ignore_ gproftpd.
Using something like this might work: grep -e " proftpd$"

Or you could use awk ... much easier to deal with fields.

Quote (mikshaw @ May 19 2007,02:41)
Try using spaces within quotes or after backshlashes:
grep " gproftpd "
or
grep \ gproftpd\ (<< a space)

Thanks.  :-)

But I think in this case it would fail on the *trailing* space, because ps tends to put the command name at the end of the line.



Patrick.

I didn't notice that part.
So as ^thehatsrule^ said, use $ as the last part of the grep (with the -e option for expression)

Quote (^thehatsrule^ @ May 19 2007,16:02)
I think he wants to _ignore_ gproftpd.
Using something like this might work: grep -e " proftpd$"

Ah.  And does the trailing `$' mean end of input?

Quote
Or you could use awk ... much easier to deal with fields.

Looks good, but from a quick skim through man [m]awk, it also looks like a bit more than I'm ready for.  Then again, it probably lists a lot of features I'd rarely use.

The FS / field separator thing kind of reminds me of the `text item delimiters' variable in AppleScript though.  Would come in handy, as soon as I figure out how to use it.  ;-)



Thanks,

Patrick.

Quote (mikshaw @ May 20 2007,04:53)
I didn't notice that part.
So as ^thehatsrule^ said, use $ as the last part of the grep (with the -e option for expression)

Umm...  Yeah I guess that is what it means.



Thanks again,

Patrick.

Next Page...
original here.