aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.markdown3
-rwxr-xr-xbin/shb2
-rw-r--r--man/man1/shb.1df7
3 files changed, 7 insertions, 5 deletions
diff --git a/README.markdown b/README.markdown
index 182269a5..7e12562c 100644
--- a/README.markdown
+++ b/README.markdown
@@ -459,7 +459,8 @@ Installed by the `install-bin` target:
[`plenv`](https://github.com/tokuhirom/plenv), filters out any modules in
`~/.plenv/non-cpan-modules`, and updates them all.
* `rgl(1df)` is a very crude interactive `grep(1)` loop.
-* `shb(1df)` attempts to build shebang lines for scripts from `$PATH`.
+* `shb(1df)` attempts to build shebang lines for scripts from the system
+ paths.
* `spr(1df)` posts its input to the sprunge.us pastebin.
* `sshi(1df)` prints human-readable SSH connection details.
* `stex(1df)` strips extensions from filenames.
diff --git a/bin/shb b/bin/shb
index 49894b0f..8f458ff1 100755
--- a/bin/shb
+++ b/bin/shb
@@ -14,7 +14,7 @@ scr=$1 intn=$2
shift 2
# Try and find the path to the interpreter command, bail out if we can't
-if ! intp=$(command -v "$intn" 2>/dev/null) ; then
+if ! intp=$(command -pv "$intn" 2>/dev/null) ; then
printf >&2 '%s: %s: command not found\n' "$self" "$intn"
exit 1
fi
diff --git a/man/man1/shb.1df b/man/man1/shb.1df
index 4f096713..1970dbde 100644
--- a/man/man1/shb.1df
+++ b/man/man1/shb.1df
@@ -14,9 +14,10 @@ command |
- awk -f
.SH DESCRIPTION
.B shb
-uses PATH to find a suitable program with the name given in the second
-argument, forms a "shebang" line from it and any arguments beyond the second,
-and then emits the contents of the first argument ('-' can be used for stdin).
+searches the system paths to find a suitable program with the name given in the
+second argument, forms a "shebang" line from it and any arguments beyond the
+second, and then emits the contents of the first argument ('-' can be used for
+stdin).
.P
This is intended as a minimal way to make portable shebang lines for Makefiles
or other building or installation frameworks, handling subtleties like sed(1)