summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStepan Kasal <kasal@ucw.cz>2004-11-23 12:49:36 +0000
committerStepan Kasal <kasal@ucw.cz>2004-11-23 12:49:36 +0000
commitde90358fb7a0aa0097a8fd8f14920e240b983aba (patch)
tree68d9c1dc0b4a777490781284509d91a8c1899e40
parentebf56907343852f6cd755c64a6095d03c0fe3131 (diff)
downloadgrep-de90358fb7a0aa0097a8fd8f14920e240b983aba.tar.gz
use the path of the script
* src/Makefile.am: The egrep and fgrep script now use their own path to construct the full pathname of grep.
-rw-r--r--ChangeLog5
-rw-r--r--src/Makefile.am8
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index a1df5862..03992ea4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2004-11-23 Stepan Kasal <kasal@ucw.cz>
+ * src/Makefile.am: The egrep and fgrep script now use their own
+ path to construct the full pathname of grep.
+
+2004-11-23 Stepan Kasal <kasal@ucw.cz>
+
* src/Makefile.am: Merged the rules for creating the egrep and
fgrep script.
diff --git a/src/Makefile.am b/src/Makefile.am
index 14c29685..3b4b8a48 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,6 +23,10 @@ OPTION_for_egrep = -E
OPTION_for_fgrep = -F
egrep fgrep: Makefile
- echo '#!/bin/sh' >$@
- echo 'exec grep $(OPTION_for_$@) $${1+"$$@"}' >>$@
+ (echo '#!/bin/sh'; \
+ echo 'case $$0 in' ; \
+ echo ' */*) dir=$${0%/*}/ ;;' ; \
+ echo ' *) dir="" ;;' ; \
+ echo 'esac' ; \
+ echo 'exec $${dir}grep $(OPTION_for_$@) $${1+"$$@"}' ) >$@
chmod a+x $@