From: harris@zk3.dec.com (Bob Harris)
Subject: Re: OSF1 grep doesn't do REs?
Date: 1998/02/22 [thread overview]
Message-ID: <harris-ya023680002202982022510001@usenet.pa.dec.com> (raw)
In-Reply-To: 34EAFC6A.794B@eddie.mit.edu
In article <34EAFC6A.794B@eddie.mit.edu>, "John Chambers (from root
account)" <jc@eddie.mit.edu> wrote:
> On this Digital UNIX V4.0B (Rev. 564) system, grep and egrep both
> seem to absolutely refuse to do regular expressions, and I was sorta
> wondering if anyone knew some trick to make them behave normally.
> ===> grep '[Ff]ork' *.c
I just tried exactly this same command and it worked correctly. Therefore
I would suspect your shell being guilty of not properly honoring the single
quota marks.
Try the following .c program to see if the arguments are being passed to
grep the way you expect them to
main(int ac, char **av)
{
printf("%s\n",av[1]);
}
If your shell is not the problem, then you should see
% test_program '[Ff]ork'
[Ff]ork
If you do not see the string within the quote marks printed out as is, then
your shell is messing with the string before it is passed to the program
(in this case the test program, but in your case grep and anyother command
that accepts strings with []'s in them).
--
Bob Harris
I don't get to tell me what to do, I only get to tell me how to do it.
The opinions expressed are my own and do not represent Digital Equipment
Corporation
prev parent reply other threads:[~1998-02-22 5:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-02-18 5:00 OSF1 grep doesn't do REs? John Chambers (from root account)
1998-02-18 5:00 ` Charles M Richmond
1998-02-20 5:00 ` Mark Taylor
1998-02-19 5:00 ` Simon Taylor
1998-02-22 5:00 ` Bob Harris [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox