diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-10-19 23:59:50 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-10-20 00:00:33 +1300 |
commit | da0f0bcae9985c666d2bb95ba0fccb7489815914 (patch) | |
tree | daf91fcd30c6114cef0d009943437d15e24a6db5 | |
parent | Remove some trailing whitespace (diff) | |
download | dotfiles-da0f0bcae9985c666d2bb95ba0fccb7489815914.tar.gz dotfiles-da0f0bcae9985c666d2bb95ba0fccb7489815914.zip |
Add -p to the command path search for shb(1df)
-rw-r--r-- | README.markdown | 3 | ||||
-rwxr-xr-x | bin/shb | 2 | ||||
-rw-r--r-- | man/man1/shb.1df | 7 |
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. @@ -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) |