aboutsummaryrefslogtreecommitdiff
path: root/bin/pp
blob: d9e45f92c0937c6ef9c9161a6161ada1c2b6e47e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
# Print the full path to each argument; file need not exist
for arg ; do
    case $arg in
        */*)
            dir=$(cd -- "${arg%/*}" ; printf '%s/' "$PWD")
            dir=${dir%/}
            ;;
        *)
            dir=$PWD
            ;;
    esac
    printf '%s/%s\n' "$dir" "${arg##*/}"
done