aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-01-06 14:27:03 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-01-06 14:28:51 +1300
commitac90f8e9a53600e00161df33b97ea5ddc5765e77 (patch)
tree4776a807c30d130fe9aa3574a25887ba7c92d841 /bin
parentAdd pp(1df) and pph(1df) (diff)
downloaddotfiles-ac90f8e9a53600e00161df33b97ea5ddc5765e77.tar.gz
dotfiles-ac90f8e9a53600e00161df33b97ea5ddc5765e77.zip
Simplify pp(1df)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pp13
1 files changed, 4 insertions, 9 deletions
diff --git a/bin/pp b/bin/pp
index d9e45f92..d9fe6488 100755
--- a/bin/pp
+++ b/bin/pp
@@ -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