in reply to Re^2: Road to a readable path (unix, non-perl)
in thread Road to a readable path

echo -e ${PATH//:/\\n}

Replies are listed 'Best First'.
Re^4: Road to a readable path (unix, non-perl)
by parv (Parson) on Jun 03, 2009 at 10:37 UTC

    Unadorned echo may or may not support a particular option, dependent on if it is a shell (which one?) built in or an external command. See the start & the bottom of GNU echo invocation; mix in korn-shell (sic) for extra fun.

    Variable expansion(substitution) is also shell dependent ...

    • generates error ${PATH/...}: Bad substitution in FreeBSD 6 /bin/sh (ash);
    • generates error Missing } in tcsh 6.15*;
    • at least works in zsh 4* & bash 3* here.