Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!sol.ctr.columbia.edu!emory!ra!Ra.MsState.Edu!fwp1 From: fwp1@CC.MsState.Edu (Frank Peters) Newsgroups: comp.unix.questions Subject: Re: csh levels Message-ID: Date: 5 Feb 91 05:22:52 GMT References: <1991Feb5.000455.9976@massey.ac.nz> Sender: usenet@ra.MsState.Edu Organization: Computing Center, Mississippi State University Lines: 23 Nntp-Posting-Host: jester.cc.msstate.edu In-reply-to: news@massey.ac.nz's message of 5 Feb 91 00:04:55 GMT In article <1991Feb5.000455.9976@massey.ac.nz> news@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@CC.MsState.Edu Bitnet: FWP1@MsState Phone: (601)325-2942 FAX: (601)325-8921