View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

mkpkg command suggestion

Jason Quinn wrote on Dec 01, 2012

In mkpkg in pkg/vocl, I noticed these two lines:

!egrep -v "\<stdlib.h\>" y.tab.c > ytab.c;
!egrep -v "\<stdio.h\>" ytab.c > ntab.c; mv ntab.c ytab.c


could be replaced with

!grep -E -v "\<std(lib|io)\.h\>" y.tab.c > ytab.c


The main advantage is higher clarity through avoidance of temporary files while also reducing 3 processes to 1. This also avoids potential clobber issues with the mv. The change to "grep -E" from "egrep" is because "egrep" is deprecated by GNU and considered historical by POSIX. The period should be escaped so that it's a literal period instead of the regex "any character".

Last post on Dec 01, 2012