1234567891011121314151617181920212223242526272829 |
- #!/bin/sh
- if [ "$1" = "-h" ]; then
- cat <<EOF>&2
- Usage: ${0##*/} PATH
- Display PATH one entry per line. If PATH is not provided, use \$PATH by default.
- EOF
- exit
- fi
- if [ $# -ne 0 ]; then
- ARG="$1"
- else
- ARG="$PATH"
- fi
- case "$ARG" in
- *:*) SEP=':';;
- *\;*) SEP=';';;
- */*) SEP='/';;
- *,*) SEP=',';;
- *\|*) SEP='|';;
- *) SEP=':';;
- esac
- echo "$ARG" | awk -v RS=$SEP '1'
|