Re: check program if running

From: Bill Thompson (bill.thompson@GOODYEAR.COM)
Date: Wed Jul 03 2002 - 08:19:39 EDT


"... | grep [p]gm" is good, but it's better to surround the string in
single quotes like this: ... | grep '[p]mg'

If you don't use the single quotes, AND pgm exists in the current directory
then the shell will expand "[p]gm" to "pgm" and your right back where you
started.

Bill Thompson
Sr UNIX Systems Administrator
The Goodyear Tire & Rubber Co.

Contains Confidential and/or Proprietary Information
May Not Be Copied or Disseminated Without Express Consent of The Goodyear
Tire & Rubber Company.

AIX-L Archives: http://marc.theaimsgroup.com/?l=aix-;&r=1&w=2

----- Original Message -----
From: "Green, Simon" <SGreen@KRAFTEUROPE.COM>
Newsgroups: bit.listserv.aix-l
To: <aix-l@Princeton.EDU>
Sent: Wednesday, July 03, 2002 5:10 AM
Subject: Re: check program if running

> > From: Bruce Harvey [mailto:BruceH@ROUTESCAPE.COM]
> > Sent: 02 July 2002 18:48
> >
> > Don't forget the "... | grep -v grep" to avoid finding your
> > grep command ...
>
> Or use the more aesthetically pleasing and fractionally more efficient
> brackets: "... | grep [p]gm"
>
> Simon Green
> Philip Morris ITSC Europe
>
> AIX-L Archive at http://marc.theaimsgroup.com/?l=aix-l&r=1&w=2
> AIX FAQ at http://www.faqs.org/faqs/aix-faq/
>
> N.B. Unsolicited email from vendors will seldom be appreciated.



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:02 EDT