csh levels

Frank Peters fwp1 at CC.MsState.Edu
Tue Feb 5 16:22:52 AEST 1991


In article <1991Feb5.000455.9976 at massey.ac.nz> news at massey.ac.nz (USENET News System) 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

Csh doesn't come with any built in way but its pretty trivial to add.
Put the following code in your .cshrc file:

if ( $?cshlevel == 0 ) then
    setenv cshlevel 1
else
    setenv cshlevel `expr $cshlevel + 1`
endif

This checks to see if cshlevel is set.  If not it sets it to one.  If
it is set then it is incremented by one.

FWP
--
Frank Peters   Internet:  fwp1 at CC.MsState.Edu         Bitnet:  FWP1 at MsState
               Phone:     (601)325-2942               FAX:     (601)325-8921



More information about the Comp.unix.questions mailing list