From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay1.UU.NET ([137.39.1.5]) by archone.tamu.edu with SMTP id <45333>; Wed, 26 Feb 1992 19:32:41 -0600 Received: from uunet.uu.net (via LOCALHOST.UU.NET) by relay1.UU.NET with SMTP (5.61/UUNET-internet-primary) id AA28146; Wed, 26 Feb 92 15:16:05 -0500 Received: from srg.UUCP by uunet.uu.net with UUCP/RMAIL (queueing-rmail) id 151022.27908; Wed, 26 Feb 1992 15:10:22 EST Received: from ceres.srg.af.mil by srg.srg.af.mil id aa22214; Wed, 26 Feb 92 14:46:48 EST From: culliton@srg.af.mil (Tom Culliton x2278) X-Mailer: SCO System V Mail (version 3.2) To: rc@archone.tamu.edu Subject: Useful rc idiom Date: Wed, 26 Feb 1992 13:47:29 -0600 Message-Id: <9202261447.aa26127@ceres.srg.af.mil> Please excuse me if I'm being redundant, I don't remember where I first saw this or discovered it, but it seems like something that should written in large letters. When writing functions in rc a useful idiom for local variables (what C calls auto) is something like this... fn func_name { xyz=() abc=$1 here=`{pwd} { # Body of the the function which can be called recursively with each # level getting it's own copy of the variables files, dirs and here. # The arguments of course are still in $1 $2 .... }} This rc stuff sure is nice, isn't it. ;-) Tom BTW - if you don't do this and reuse variables inside a recursive function it can be very hard to track down whats going on. ;-)