news@bbn.COM (News system owner ID) (02/09/89)
> In article <739@umb.umb.edu> pme@umb.edu (Paul English) writes: > >Since this type of thing usually makes your prompt so long that you > >usually tend to ignore it, why have it there in the first place? If > >you really need an easy way of reminding yourself where you are, you > >could do something like the following to make it easy to get this info > >on demand: > > > > alias . echo `hostname`: `dirs` > > > > I agree. While my host names are short so they are OK to embed in > the prompt, I would find having the full dir pathname in the prompt > very annoying. I agree it's better to just make it quick to > find out where you are. > My solution is to put only the last part of the directory into the prompt: that means i don't absolutely know where i am (there's more than one .../etc), but usually i only want to disambiguate one of a limited number of distinct possibilities. If i have to run another command to find out, i tend to just not do it. I'm open to suggestions for a nicer way to do it: alias cd 'cd \!*; set here=`pwd`; set prompt = "\! ..$here:t> "' alias pushd 'pushd \!*; cd .' alias popd 'popd \!*; cd .' ........................................ Sean Boisen -- sboisen@bbn.com BBN Systems and Technologies Corporation, Cambridge MA Disclaimer: these opinions void where prohibited by lawyers. Sean
dean@usceast.UUCP (Dean Karres) (02/10/89)
In article <35782@bbn.COM> sboisen@bbn.com writes: >>In article <739@umb.umb.edu> pme@umb.edu (Paul English) writes: >>>... >>> alias . echo `hostname`: `dirs` >>... >My solution is to put only the last part of the directory into the >prompt: I came across this posting this evening so if my suggestion has already been posted and rejected please forgive :-) On the BSD/Ultrix/SUN OS boxes that I deal with my prompt is set as follows: set host = `hostname` set prompt = "$host - `pwd`\ % " alias cd 'cd \!*; set prompt = "$host - `pwd`\\ % "' alias po 'popd; set prompt = "$host - `pwd`\\ % "' alias pu 'pushd \!*; set prompt = "$host - `pwd`\\ % "' This gives me the ability to have complete, though potentially long, paths showing that do not interfear with my command line. The general effect is: monster - /usr/local/not-so-local/.../.../.../.../.../.../... % I do the "set host = `hostname`" because I think that the variable substitution is "faster" than the "hostname" evaluation. I do not know this for a fact. Dean...k... -- Dean Karres US-Mail: Math & Stat Comp Cntr, Math Dept, USC, Columbia, SC 29208 E-Mail: ...{gatech!hubcap, mcnc!ece-csc}!ncrcae!usceast!dean - or -: relay.cs.net!cs.scarolina.edu!dean -- E-Mail: ...{gatech!hubcap, mcnc!ece-csc}!ncrcae!usceast!dean =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Adaz sighed, "So how long will this trip take?" "A month?" Sutekh shrugged. "Depends on when the horses die."