$ grep --version grep (GNU grep) 2.4.2 Copyright 1988, 1992-1999, 2000 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
if echo GNU | egrep '(GNU|BFD)' >/dev/null; then echo "Good egrep"; \ else echo "Bad egrep"; fi Bad egrep
だめじゃん。
tar jxf tgz/grep-2.5.1a.tar.bz2 cd grep-2.5.1a.tar.bz2 ./configure --prefix=/usr make ---( -インストール ---( su make install ---( -確認 ---( cd /usr/bin ls -lt | head -rwxr-xr-x 1 root root 33 Jan 31 23:53 egrep -rwxr-xr-x 1 root root 33 Jan 31 23:53 fgrep -rwxr-xr-x 1 root root 267572 Jan 31 23:53 grep
strip grep
ls -lt | head -rwxr-xr-x 1 root root 81692 Jan 31 23:54 grep -rwxr-xr-x 1 root root 33 Jan 31 23:53 egrep -rwxr-xr-x 1 root root 33 Jan 31 23:53 fgrep
if echo GNU | egrep '(GNU|BFD)' >/dev/null; then echo "Good egrep";\ else echo "Bad egrep"; fi Good egrep
大丈夫
$ ./configure --prefix=/usr Tue Feb 1 22:52:00 JST 2005
$ make && date ... ... Tue Feb 1 22:53:49 JST 2005
$ su # make install
# cd /usr/bin # ls -lt | head -rwxr-xr-x 1 root root 33 Feb 1 22:54 egrep -rwxr-xr-x 1 root root 33 Feb 1 22:54 fgrep -rwxr-xr-x 1 root root 261009 Feb 1 22:54 grep # strip -p grep # ls -lt | head -rwxr-xr-x 1 root root 33 Feb 1 22:54 egrep -rwxr-xr-x 1 root root 33 Feb 1 22:54 fgrep -rwxr-xr-x 1 root root 80916 Feb 1 22:54 grep