Hi Bruno, Thanks for your swift response!
To be honest, I would prefer to standardise on 'grep -E' instead of
egrep and 'grep -F' instead of fgrep.
The reason is that I believe that it is not necessarily clear what egrep
and fgrep really are, e.g. on Debian sarge and Mandriva 2006 (yep, I
just installed it in qemu, as that's what you are using... ;-) ) they
are just scripts that use grep:
> cat /bin/egrep
#!/bin/sh
exec grep -E ${1+"$@"}
> cat /bin/fgrep
#!/bin/sh
exec grep -F ${1+"$@"}
In this case, spawning another shell can be quite a bit of overhead
especially in loops, so not so good, really.
My understanding is further that egrep and fgrep have been deprecated
some time ago by POSIX in favour of 'grep -E' and 'grep -F'
respectively. I don't have access to POSIX standards or changelogs,
unfortunately. Do you have access via HP maybe (, could be useful for
other things as well)?
I would be happy to go through SVN stable and change all occurrences
along with applying the patch itself, if you are happy with this.
Cheers,
Andree
On Sat, 2006-06-24 at 09:39 +0200, Bruno Cornec wrote:
> Hello,
>
> Andree Leidenfrost said on Sat, Jun 24, 2006 at 01:49:20PM +1000:
>
> > [Bruno: As usual my request for approval. Fairly obvious and low risk I
> > believe. Can I submit attached patch to stable?]
>
> Yep. I generally use egrep myself rather than grep -E, but they are
> similar (from the man page).
>
> ~/mondo/svn/branches/stable > grep -r egrep . | grep -v \.svn
> ./mindi/mindi: tr ' ' '\n' < $outfile.pre | tr -s '/' '/' | fgrep -vx "" |
> sort -u | egrep -v "/libX11|/libXext|/libXi|/libgtk|/libgdk" > $outfile
> ./mindi/mindi: | egrep -v "((none|/tmp|/ISOs|/proc|/dev/root) )|/mnt/" \
> ./mindi/mindi: j=`find $imagesdir -type f | fgrep "/mindi-boot" | egrep -v
> '2880|5760'`
> ./mindi/mindi: for fname in `find $root -maxdepth 2 -type f | fgrep lin |
> egrep -v '^/proc/|^/net/'` ; do
> ./mindi/mindi:[ -f "$MINDI_LIB/vmlinuz" ] && FAILSAFE_KVER=`strings
> $MINDI_LIB/vmlinuz 2> /dev/null | egrep "2\.[46]" | cut -d' ' -f1`
> ./mondo/mondo/common/libmondo-devices.c: ("parted2fdisk -l
> 2>/dev/null | grep '^/dev/' | egrep -qv '(MS|DOS|FAT|NTFS)'");
>
> [...]
>
> So if you don't mind, I would prefer to standardize on this, except if
> you prefer to do the reverse (change all occurences of egrep with grep
> -E)
>
> Anyway, a patch such as the one you propose, should go in SVN clearly.
>
> Bruno.
signature.asc
Description: This is a digitally signed message part

