csh levels
Boyd Roberts
boyd at necisa.ho.necisa.oz.au
Wed Feb 6 10:43:42 AEST 1991
>In article <1991Feb5.000455.9976 at massey.ac.nz> R.Singh at 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 at necisa.ho.necisa.oz.au
``When the going gets wierd, the weird turn pro...''
More information about the Comp.unix.questions
mailing list