getting shells in the same path

Often I work with a couple of shells simultaneously in the same directory. One may be the editor with a program in it, and the other one running it.
When I add the following lines to .bashrc

alias sd='pwd > /tmp/ddd'
alias d='cd `cat /tmp/ddd`; pwd'

I just need to type ’sd’ (for Set Directory) in a shell that is already in the right directory. When I then log in with the other shell a simple ‘d’ gets me where the other shell already is. Extra benefit: When I want to continue where I was last I just type ‘d’ again. Just a little thing. But the world is made out of little things. Lots and lots of them.

Leave a Reply

You must be logged in to post a comment.