Monday, March 22, 2010

Show PATH elements one per line

Using the 'tr' (translate) command in a function can yield some handy
"shortcuts":

path ()
{
        echo $PATH | tr ':' '\n'
}
manpath ()
{
        echo $MANPATH | tr ':' '\n'
}

These functions will spit out the elements of a PATH, one per line.
You can add these functions in your .profile or some other "rc" file,
or use the nifty autoload feature of the ksh.
----------------------------------------------------------------
print - ${PATH//:/\\n}
 

No comments:

Post a Comment