aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/pp13
-rw-r--r--man/man1/pp.1df2
2 files changed, 6 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
diff --git a/man/man1/pp.1df b/man/man1/pp.1df
index 1c7aca70..322e7b48 100644
--- a/man/man1/pp.1df
+++ b/man/man1/pp.1df
@@ -9,6 +9,8 @@
.B pp
uses $PWD to print the full path to each of its arguments, unless they begin
with a slash, in which case they are printed verbatim.
+.P
+The path need not actually exist.
.SH CAVEATS
Newlines in filenames will still work, but the results won't really make sense
as they'll be indistinguishable from newlines separating the files. This is for