Unix question
Kenneth Brody
kenbrody at bestweb.net
Fri Apr 16 09:09:26 PDT 2004
(Top-posting and improper quoting corrected.)
> > > Thanks.
> > > The quotes were not necessary. Ken's example worked perfectly.
> > > I was trying to look for the string rctp(54)=
> > > The \ is a escape character (just like in filePro) to tell grep (I guess)
> > > that the ( and ) are part of the string being searched,
> > [...]
> > > > grep rcpt\(54\)= prc.*
> > [...]
> >
> > If that was your intent, it didn't do what you wanted, since the
> > shell sees them first. You need to double them to get one passed
> > to the program.
>
> Double what?
> I wanted: rcpt(54)=
> I used the example you gave me and it worked perfectly.
> I don't need to see the \
> Am I missing something?
You said that the backslashes were "to tell grep that the ( and ) are
part of the string being searched". With the command you wrote, grep
will never see the backslashes, as they will be eaten by the shell.
If your intention were to pass backslashes to grep, you would have
had to double the backslashes. As written, it is the shell that you
are telling to pass the parens to grep, rather than having the shell
give them special meaning. (Or, just put it in quotes, and leave the
backslashes off.)
--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody at spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
More information about the Filepro-list
mailing list