Don't exec self

Sat, 06 Jul 2019 22:09:22 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Sat, 06 Jul 2019 22:09:22 -0400
changeset 774
d6a54f86ab10
parent 773
36a9b54b0eea
child 775
aa82db8862ab

Don't exec self

bin/perldoc file | annotate | diff | comparison | revisions
--- a/bin/perldoc
+++ b/bin/perldoc
@@ -8,4 +8,6 @@ fi
 if [ -x "$(command -v cpandoc)" ]; then
   exec cpandoc $*
 fi
-exec perldoc $*
+
+BIN="$(which -a perldoc | grep -v $0 | head -n 1)"
+exec $BIN $*

mercurial