marco@cselt.UUCP (Marco Mercinelli) (02/13/86)
These two aliases allow to set a directory as a default work directory, so you it can be accessed immediatly. Passing arguments you can select more than one work directory (only for 4.[23] sites because of the symbolic link) alias setwork 'rm -f ~/.wrk."\!*"; ln -s `pwd` ~/.wrk."\!*"' alias work 'cd ~/.wrk."\!*";echo "work dir: `pwd`"' Examples: 1 > pwd /usr1/marco/doc/course/cc/lint 2 > setwork 3 > cd /usr1/marco/sources/newfonts 4 > setwork nf 5 > work work dir: /usr1/marco/doc/couse/cc/lint 6 > work nf work dir: /usr1/marco/sources/newfonts 8 >
jerryp@tektools.UUCP (Jerry Peek) (02/17/86)
In article <73@cselt.UUCP> marco@cselt.UUCP (Marco Mercinelli) writes: > These two aliases allow to set a directory as a default work directory, > so you it can be accessed immediatly. > Passing arguments you can select more than one work directory > (only for 4.[23] sites because of the symbolic link) > > alias setwork 'rm -f ~/.wrk."\!*"; ln -s `pwd` ~/.wrk."\!*"' > alias work 'cd ~/.wrk."\!*";echo "work dir: `pwd`"' Nice idea. It's better than using shell variables to save the directory names because the symlinks stay around after you log out. Here's one more alias. It lists the working directories that you've accumulated. Colrm chops off the permissions, date, etc. You'll have to change the second colrm argument from 62 to whatever works with your home-directory path. alias listwork 'ls -l ~/.wrk.* | colrm 1 62' Example: % listwork dev -> /class/devd1 make -> /tc1/jerryp/training/make/labs % ls -l ~/.wrk* lrwxr-xr-x 1 jerryp 12 Feb 17 08:45 /tc1/jerryp/.wrk.dev -> /class/devd1 lrwxr-xr-x 1 jerryp 30 Feb 17 08:45 /tc1/jerryp/.wrk.make -> /tc1/jerryp/training/make/labs --Jerry Peek, Tektronix, Inc. US Mail: MS 74-222, P.O. Box 500, Beaverton, OR 97077 uucp: {allegra,decvax,hplabs,ihnp4,ucbvax}!tektronix!tektools!jerryp CS,ARPAnet: jerryp%tektools@tektronix.csnet Phone: +1 503 627-1603
sgt@alice.UucP (Steve Tell) (02/26/86)
Here's a similar scheme that several people have been using on both csh and ksh: csh: alias d1 'set D1=`pwd`' alias cd1 'cd $D1' ksh: alias -x d1="D1=\$PWD" alias -x cd1="cd \$D1" Typicaly, one has, say, d1 through d6. I usually only use two or three of them, and set them up so the numbers relate to which is "primary" to the task at hand in some way. Another usefull alias is one that prints the contents of $D1-$D6.
stevenh@tekig4.UUCP (Steve Herring) (03/01/86)
>Here's a similar scheme that several people have been using on both >csh and ksh: > >csh: >alias d1 'set D1=`pwd`' >alias cd1 'cd $D1' Replacing `pwd` with $cwd will make d1 execute much faster. As in: alias d1 'set D1=$cwd' Steve Herring ...!tektronix!tekig4!stevenh
aglew@ccvaxa.UUCP (03/10/86)
Another set of working directory aliases. I like to have a lot, with names. "mark" remembers one; "Mark" saves it. I'm getting enough to make it work saving them in a separate file that I source in my .cshrc, and to put ifs around the saved line to distinguish different machines. Plus something that says "you've already defined this place, stupid!". But for the short term, these are enough. alias mark 'set \!:1=`pwd`; alias \!:1 cd $\!:1' alias Mark mark \!:1 \; echo '>> ~/.cshrc' set \!:1 = `pwd` \\\; alias \!:1 cd '$'\!:1