Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!iconsys!ohs!mday From: mday@ohs.UUCP (Matthew T. Day) Newsgroups: comp.unix.questions Subject: Re: alias to link cd to pwd Message-ID: <307@ohs.UUCP> Date: 8 Jun 89 21:16:57 GMT References: <3710@tank.uchicago.edu> Lines: 24 in article <3710@tank.uchicago.edu>, phd_ivo@gsbacd.uchicago.edu says: > > > A long time ago, I had a script that links a cd to > reset the prompt to the currently connected directory. > > ... > Here's what I use, and it takes advantage of the built-in $cwd variable in the Berkeley C-Shell, which drastically decreases the time needed to change directories. It also uses the 'chdir' alternative to avoid recursive aliases. The SysV C-Shell that I used didn't have $cwd, so if yours doesn't, simply try putting backslashes in front of the back "execution" quotes around `pwd`. alias sp 'set prompt = "$cwd"\>\ ' alias cd 'chdir \!^; sp' It works great, have fun. -- +----------------------------------------------------------+-----------------+ | Matthew T. Day, Orem High School, Orem, Utah | "He who laughs, | | Internet: mday@ohs.uucp UUCP: ..!uunet!iconsys!ohs!mday | lasts." | +----------------------------------------------------------+-----------------+