Re: Repalcement for grep(1)
Jamie Howard writes: > > Perhaps this will help with -w? > > Yes, I received a patch from Simon Burge which implements this. It also > beats using [^A-Za-z] and [A-Za-z$] as I was and GNU grep does. I am > still having trouble with -x though. It turns out that even if I specify > a commandline with a pattern of the form "^pattern$", it fails. If I > specify "^pattern" it works. If I specify "pattern$" it does not. I > have yet to find a case where my version will sucessfully match when a $ > is at the end. Has anyone encountered anything like this before? If you are using double quotes, as you show here, the shell may be attempting a variable substitution. Try single quotes. -Pat To Unsubscribe: send mail to majord...@freebsd.org with "unsubscribe freebsd-hackers" in the body of the message
Re: "!.*" [ was: Fdescfs updates--coming to a devfs near you! ]
On 14-Sep-00 at 05:37, Poul-Henning Kamp ([EMAIL PROTECTED]) wrote: > >You think adding a hack to every program to support "-" to mean > >stdout/stdin is better? > > The majority of these programs could be handled by adding knowledge > of "-" as a magic filename to fopen(3). > > At the same time I would really love if we implemented "|.*" to mean > "do an popen(3)" instead. Isn't that potentially a huge security hole in every program that gets a filename from an external source? > But of course, this is bikeshed material... > > >> If anything I would propose we ditch it... > > > >And break loads of scripts at the same time? > > I would argue that the programs and the scripts that call them are > already broken, but hey... And I would argue that the fdescfs is cleaner than the '-' hack. (Which, by the way, should not be considered a filename hack so much as a command-line-parameter hack; since it was invented before there was a way to say 'use stdin/stdout' on the command-line... You could think of '/dev/stdin' as "'-' version 2") -Pat To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Repalcement for grep(1)
Jamie Howard writes: > > Perhaps this will help with -w? > > Yes, I received a patch from Simon Burge which implements this. It also > beats using [^A-Za-z] and [A-Za-z$] as I was and GNU grep does. I am > still having trouble with -x though. It turns out that even if I specify > a commandline with a pattern of the form "^pattern$", it fails. If I > specify "^pattern" it works. If I specify "pattern$" it does not. I > have yet to find a case where my version will sucessfully match when a $ > is at the end. Has anyone encountered anything like this before? If you are using double quotes, as you show here, the shell may be attempting a variable substitution. Try single quotes. -Pat To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message