From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,e0f812932bdb4520 X-Google-Attributes: gidfee84,public From: harris@zk3.dec.com (Bob Harris) Subject: Re: OSF1 grep doesn't do REs? Date: 1998/02/22 Message-ID: #1/1 X-Deja-AN: 327680229 Content-Transfer-Encoding: 8bit References: <34EAFC6A.794B@eddie.mit.edu> Content-Type: text/plain; charset=ISO-8859-1 Organization: Digital Equipment Corporation Mime-Version: 1.0 Newsgroups: comp.unix.osf.osf1 In article <34EAFC6A.794B@eddie.mit.edu>, "John Chambers (from root account)" 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