From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,e0f812932bdb4520,start X-Google-Attributes: gidfee84,public From: "John Chambers (from root account)" Subject: OSF1 grep doesn't do REs? Date: 1998/02/18 Message-ID: <34EAFC6A.794B@eddie.mit.edu>#1/1 X-Deja-AN: 326243143 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Digital Equipment Corp (soon to be Compaq) Newsgroups: comp.unix.osf.osf1 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. In checking with "man grep", I find that the RE stuff seems to have been radically expanded, with things called BREs and EREs, and no apparent clues as to how to tell the little beasties to enable one or the other. Is there some magical incantation that's needed to make it work? Here's proof of the problem, in a directory with lots of *.c files. As you can see, there are several examples of 'fork' and 'Fork' in the files, but '[Ff]ork' doesn't match anything. Using egrep gives exactly the same output. ===> which grep /sbin/grep ===> grep fork *.c conn.c:* Connect two ports together. This program forks, and each process then ping.c: perror("ping: fork"); tcpserver.c:* Wait for a connection. When we get one, we fork off a child to root@ral1::jc/src/misc: grep Fork *.c conn.c: D5("Fork ..."); conn.c: if ((pid1 = Fork()) <= 0) { conn.c: if ((pid2 = Fork()) <= 0) { ping.c: if ((pid = Fork()) < 0) { proxy.c: if (Fork()) { tcpserver.c: if (child = Fork()) { ===> grep '[Ff]ork' *.c ===> Tests with any REs other than literal strings always fail. Patterns like 'f.*k' and 'f*ork' also fail, though both should match the 'fork' strings as shown above.