Programming and Scripting :: Simple shell-based daemon



Well field separators are even in posix shells by standard...

You can look up "anchors" in regexp. Also, I think gnu's grep uses -e if needed automatically, but better keep to the standard (or use egrep.. which has slight differences)

Quote
does the trailing `$' mean end of input?

I think it technically means "end of line" when talking about regular expressions in general, but i think in the case of grep, end of line and end of input would be pretty much the same.

I thought for a minute that  you might be able to do multiple lines with " grep end_of_first_line$beginning_of_next_line" (or something similar), but it seems to present unexpected results.

for some reason the end-of-string anchor '$' doesn't work (v2.1b at least).

you can use the word boundary anchor '\b' instead

i.e   ps | grep "proftpd\b"

[Edit] oops,

or rather;      ps | grep "\bproftpd\b"        for the whole word.

[/Edit]

humpty, that's probably a busybox bug... since that was updated in newer 3.x versions.
Thanks, they both work.  :-)

It also issues a warning, before running the FTP server *and* PPP at the same time, now that my *nix-box can dial out directly [don't know if anyone noticed the addition of a `pon/poff' thing in there, but it's not hiding behind a router anymore].



Cheers,

Patrick.

Next Page...
original here.