On a server I work on, I always have to work in a directory, let's call it
/foo/bar. In that directory is a list of site directories. Inside each of those directories is a directory for each developer. So, the tree looks like this:
/foo/bar/ site1/ userA/ userB/ userC/ site2/ userA/ userB/ userC/ site3/ userA/ ...
I set up an alias for the root directory in my .bash_profile,
fb=/foo/bar, so my workflow looks like this:
$ cd $fb $ cd site2 $ cd userA
The first and third lines never change--I'm always going to go to the
userA directory of whatever site directory I change to.
My question: Is there a clever way I can compress this into a single command that I just pass the "site2" argument without having to build this into a shell script? Or is the shell script the only way?