Date: Thu, 10 Jun 1999 20:20:35 -0700 (PDT) From: Bart Trzynadlowski <trzy@powernet.net> To: Mark Ovens <markov@globalnet.co.uk> Cc: freebsd-questions@freebsd.org Subject: Re: prompts Message-ID: <Pine.BSF.4.05.9906102016310.688-100000@Brzuszek> In-Reply-To: <19990611014637.G255@marder-1>
next in thread | previous in thread | raw e-mail | index | archive | help
This works great in csh. There is one little quirk: when I cd to /home (which is a link to /usr/home) it prints /usr/home and to go down to / I have to issue cd .. twice. In zsh it prints /home and I only have to cd .. once. Can this be fixed? Once again, its not a big deal though, just curious. But the alias for cd you gave me does not work under sh. And also, the character # for superuser and $ or % for user... how does the shell change this? In zsh I think /# sets # for superuser and % for user. How can I set the prompt up so that if I'm a superuser it uses # and if I'm a user it uses $ under sh and csh. Do I just use "#"? I tried doing PS1="`pwd`# " in sh but it printed # for the regular users. > For csh you need to alias ``cd''. If you just do a ``set prompt='' > like you tried then it is static, that is you set the variable > "prompt" to the value it was at that point in time (actually, what > you did was wrong anyway, you needed ``set prompt = "`echo $cwd`#") > > You need to update the variable "prompt" every time you ``cd''. To > get what you want, add the following to ~/.cshrc (so it applies to > all shells that you start): > > alias cd 'cd \!*;set prompt="`pwd`# "' > > % > % cd > % alias cd 'cd \!*;set prompt="`pwd`# "' > % > % > % cd > /usr/marko# cd /etc > /etc# cd /mnt > /mnt# > > HTH > > > > Thanks a lot! > > > > Bart Trzynadlowski > > > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > with "unsubscribe freebsd-questions" in the body of the message > > > > -- > FreeBSD - The Power To Serve http://www.freebsd.org > My Webpage http://www.users.globalnet.co.uk/~markov > _______________________________________________________________ > Mark Ovens, CNC Apps Engineer, Radan Computational Ltd. Bath UK > CAD/CAM solutions for Sheetmetal Working Industry > mailto:marko@uk.radan.com http://www.radan.com > > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9906102016310.688-100000>