This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: issue with grep [^]


> If I type:
>     cat x.txt | grep \\-[0-9]\)
> it works great - the lines containing it are correctly returned.
> 
> But typing:
>     cat x.txt | grep \\-[^0-9]\)
> doesn't work - the same result occurs as the first case above, like the ^ is
> ignored.

     ^ is the quoting character for NT's CMD.EXE (bash doesn't exhibit 
this problem).  Also note that CMD.EXE requires | must be double 
quoted if you're passing it through a pipe (again bash doesn't need 
this):

F:\temp>echo ^| | cat
The syntax of the command is incorrect.

F:\temp>echo ^^^| | cat
|

F:\temp>bash
$ echo \| | cat
|
$ echo \\\| | cat
\|

Follow start menu => help => Windows NT commands => command symbols 
for docs on CMD.EXE's special characters.  Or just spend you time in 
bash, which is friendlier and more featureful:-)


-------d-o---y-o-u---s-e-e---G-o-d---i-n---c-o-n-v-e-c-t-i-o-n-?--------
"oncology recapitulates philately" --Mark Maxson    Robert M. Praetorius
"balance, not symmetry" --Mark Stanley         home: rmp@MA.UltraNet.Com
(attribution by Stigler)                  work: RPraetorius@AspenRes.Com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]