zsh-users
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@u.genie.co.uk>
To: "Cosgray, Nathan" <ncosgray@iupui.edu>
Cc: zsh-users@sunsite.auc.dk
Subject: Re: Help with functions
Date: Fri, 28 Apr 2000 11:15:28 -0400	[thread overview]
Message-ID: <3909AB10.6076@u.genie.co.uk> (raw)
In-Reply-To: <154A66C813EED311AECB00508B8B8D093F45EE@iupuimbx06.uits.iupui.edu>

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



  reply	other threads:[~2000-04-30 13:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-27 20:18 Cosgray, Nathan
2000-04-28 15:15 ` Oliver Kiddle [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-04-27 16:00 Cosgray, Nathan
2000-04-26 21:02 Cosgray, Nathan
2000-04-26 20:22 Cosgray, Nathan
2000-04-26 20:41 ` Thomas Köhler
2000-04-27  0:40 ` Oliver Kiddle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3909AB10.6076@u.genie.co.uk \
    --to=opk@u.genie.co.uk \
    --cc=ncosgray@iupui.edu \
    --cc=zsh-users@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).