6/15/2006
Directory Shortcuts Using Bash Functions
Modify this snippet to match the directory shortcuts you need on your system and add into your .bashrc file:
www () {
if [ $1 == "domain1" ]; then
cd /www/vhosts/domain1.com/htdocs
elif [ $1 == "domain2" ]; then
cd /www/vhosts/domain2.com/htdocs
else
cd /www/vhosts/$1 ;
fi
echo `pwd`;
}
if [ $1 == "domain1" ]; then
cd /www/vhosts/domain1.com/htdocs
elif [ $1 == "domain2" ]; then
cd /www/vhosts/domain2.com/htdocs
else
cd /www/vhosts/$1 ;
fi
echo `pwd`;
}
To use:
www domain1
Popularity: 13%


