From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22842 invoked from network); 30 Apr 2000 13:27:55 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 30 Apr 2000 13:27:55 -0000 Received: (qmail 16613 invoked by alias); 30 Apr 2000 13:27:40 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3052 Received: (qmail 16600 invoked from network); 30 Apr 2000 13:27:39 -0000 Message-ID: <3909AB10.6076@u.genie.co.uk> Date: Fri, 28 Apr 2000 11:15:28 -0400 From: Oliver Kiddle X-Mailer: Mozilla 3.0C-NC320 (Win95; U) MIME-Version: 1.0 To: "Cosgray, Nathan" CC: zsh-users@sunsite.auc.dk Subject: Re: Help with functions References: <154A66C813EED311AECB00508B8B8D093F45EE@iupuimbx06.uits.iupui.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cosgray, Nathan wrote: > > FYI, I have fixed this problem by adding the following line to the END of > the script in question: > > $* > > thus explicitly calling the function passed in the parameters to > run_masterfile_step. It seems like a giant hack to me, but at least it > works. Sorry, I should have been clearer in my first reply. Putting the $* at the end was significant because it needs to be after the functions are defined otherwise the functions won't exist yet. In shell scripts, functions are a bit like normal statements in that when control reaches the line on which the function is defined, only then does the function become defined. This means that you can do tricks like defining two different versions of a function with the same name inside an if ... then ... else. I wouldn't call it a giant hack at all. I suspect that the $* was there originally and got lost at some point. > Where can I find documentation on '$@' and other such nifty things? Have you got a copy of the manual somewhere? If not, you can browse the HTML version on the zsh web pages at sunsite.auc.dk/zsh. There is a section listing special parameters like $@ and $*. I would give you some better references but I don't have access to the manual myself at the moment. You may find the manual a bit heavy going so any book on UNIX shell scripting will be mostly relevant to zsh scripts (but stick to sections on the bourne/korn shells avoiding anything on the C-shell). Oliver Kiddle