diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-01-06 14:27:03 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-01-06 14:28:51 +1300 |
commit | ac90f8e9a53600e00161df33b97ea5ddc5765e77 (patch) | |
tree | 4776a807c30d130fe9aa3574a25887ba7c92d841 /bin/pp | |
parent | Add pp(1df) and pph(1df) (diff) | |
download | dotfiles-ac90f8e9a53600e00161df33b97ea5ddc5765e77.tar.gz dotfiles-ac90f8e9a53600e00161df33b97ea5ddc5765e77.zip |
Simplify pp(1df)
Diffstat (limited to 'bin/pp')
-rwxr-xr-x | bin/pp | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -1,14 +1,9 @@ #!/bin/sh -# Print the full path to each argument; file need not exist +# Print the full path to each argument; path need not exist for arg ; do case $arg in - */*) - dir=$(cd -- "${arg%/*}" ; printf '%s/' "$PWD") - dir=${dir%/} - ;; - *) - dir=$PWD - ;; + /*) path=$arg ;; + *) path=$PWD/$arg ;; esac - printf '%s/%s\n' "$dir" "${arg##*/}" + printf '%s\n' "$path" done |