Mailing List Archive

Support open source code!


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

Re: funny bug



>On Fri, Mar 30, 2001 at 02:22:00PM +0900, Viktor Pavlenko wrote:
>> >Thanks for sharing the bug. Not knowing much about shell
>> >scripting I was wondering if you could explain the bug?
>> >It's a bit too subtle for me ;)
>>=20
>> Shell expands [pP]rog_name to progname if progname is in the
>> current directory and grep process name becomes `grep progname'.
>> So `ps -ef | grep progname' will show the grep process too.
>>=20
>> And `ps -ef | grep '[pP]rogname'' will not.
>
>I suppose that's simpler than adding "| grep -v grep".
>

grep '[p]rogname'  ....

(I think I was feeling too smart when writing [pP])


>--=20
>Austin K. Kurahone
>Tokyo Linux Users Group / SIGUSR1 R&D
>Hail Eris! All Hail Discordia!
>"One must still have chaos in one to give birth to a dancing star!" --Nietz=
>she=20

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links