Path: utzoo!attcan!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!apollo!vinoski From: vinoski@apollo.COM (Stephen Vinoski) Newsgroups: comp.unix.wizards Subject: Re: Positional Parameter Settin in function Message-ID: <43b55bf9.13868@apollo.COM> Date: 8 Jun 89 14:01:00 GMT References: <570024@hpsemc.HP.COM> Reply-To: vinoski@zep.UUCP (Stephen Vinoski) Organization: Apollo Computer, Chelmsford, MA Lines: 34 In article <570024@hpsemc.HP.COM> gph@hpsemc.HP.COM (Paul Houtz) writes: > >In my ksh, the "set" command doesn't seem to work within a function: > > $ set `date` > $ echo $4 > 16:31:00 > >Now if I declare a function: > > $ foo () { > / set `date` > / } > > $ foo > $ echo $4 > 16:31:00 > >As you can see, the old `date` is still in the positional parameters, otherwise >the seconds part of the date should have changed by now. In ksh, positional parameters are not shared between the function and its caller. Try "The Kornshell Command and Programming Language", Morris I. Bolsky and David G. Korn, Prentice-Hall, 1989, ISBN 0-13-516972-0. It's a great book. -steve -- Steve Vinoski ## Apollo, a Subsidiary of HP ## ARPA: vinoski@apollo.com (508)256-6600 x5904 ## Chelmsford, MA 01824 ## UUCP: ...!apollo!vinoski "...no hardware designer should be allowed to produce any piece of hardware until 3 software guys have signed off for it." -Andy Tanenbaum