Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!think.com!samsung!munnari.oz.au!metro!cluster!necisa!boyd From: boyd@necisa.ho.necisa.oz.au (Boyd Roberts) Newsgroups: comp.unix.questions Subject: Re: csh levels Message-ID: <2011@necisa.ho.necisa.oz.au> Date: 5 Feb 91 23:43:42 GMT References: <1991Feb5.000455.9976@massey.ac.nz> <5948@idunno.Princeton.EDU> Organization: NEC Information Systems Australia Pty. Ltd. Lines: 27 >In article <1991Feb5.000455.9976@massey.ac.nz> R.Singh@massey.ac.nz (R. Singh) writes: >Let's assume a csh invoked from a csh. How do keep track of how far down >the track, one is? Let's say one has recursively invoked csh, it should be >possible to discover how far down one is. How does one do it? >Thanx > Back in the dim distant past I used to have my prompt set to indicate how many C shells I had and whether they were root shells or me (now that's _quite_ a while back -- ugh -- the horrors of C shell). I have since returned to the fold and use a V8 style Bourne shell. I had this variable $cshdepth which had a `#' or `%' appended to it in my .cshrc depending on the uid of the shell. $cshdepth would then set part of my prompt, so I'd get a display like this: 1% /bin/su Password: # exec csh 1%# You get the idea? Boyd Roberts boyd@necisa.ho.necisa.oz.au ``When the going gets wierd, the weird turn pro...''