Linux.com

Retain and recall long paths with rr utility

Posted by: Anonymous [ip: 82.95.236.142] on October 16, 2007 08:20 PM
Here's a somewhat related shell function you could put in

~/.bashrc or ~/.bash_profile:





cdof()

{

# cd to the directory of a file



if [ -d $1 ]

then

builtin echo "$1: Is a directory"

return 1

else

# cd `dirname $1`

builtin cd ${1%${1##*/}}

fi

}







Bauke Jan Douma


#

Return to Retain and recall long paths with rr utility