Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!uccba!uceng!kamat From: kamat@uceng.UC.EDU (Govind N. Kamat) Newsgroups: comp.unix.wizards Subject: Re: sh functions with "local variables" Message-ID: <1206@uceng.UC.EDU> Date: 18 Jun 89 11:17:02 GMT References: <1397@marvin.Solbourne.COM> Organization: College of Engg., Univ. of Cincinnati Lines: 22 In article <1397@marvin.Solbourne.COM> dce@Solbourne.com (David Elliott) writes: +>Now, in modern versions of sh (post SVR2, I think), function parameters +>are local to the function, but there's no way to have local variables +>otherwise. +> +>Now, if the function doesn't have any arguments, or if you can use +>the arguments early and get rid of them, you can use "set" to put +>values in $1-$9, which is one way to have local variables. Still, +>real local variables would be great. +> +>Of course, arrays would be nice, too. +> +>Maybe it's time to implement sh++? Well, ksh, which is already around allows you to define true local variables, using the "typeset" command. It also includes support for arrays. -- Govind N. Kamat College of Engineering kamat@uceng.UC.EDU University of Cincinnati Cincinnati, OH 45221, USA