ambevar-dotfiles/.scripts/echopath

22 lines
295 B
Bash
Executable File

#!/bin/sh
if [ "$1" = "-h" ]; then
cat<<EOF
Usage: ${0##*/} PATH
Display PATH one entry per line. If PATH is not provided, use \$PATH by
default. PATH must be a ':' separated list.
EOF
exit
fi
if [ $# -ne 0 ]; then
ARG="$1"
else
ARG="$PATH"
fi
echo "$ARG" | sed 's/:/\n/g'