zsh-users
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Dietmar Rempfer <dietmar@sokrates.mae.cornell.edu>,
	borsenkow.msk@sni.de, zsh-users@math.gatech.edu
Subject: Re: Help on zsh grammar
Date: Wed, 22 Jan 1997 11:35:59 -0800	[thread overview]
Message-ID: <970122113559.ZM3128@candle.brasslantern.com> (raw)
In-Reply-To: Andrej Borsenkow <borsenkow.msk@sni.de> "Re: Help on zsh grammar" (Jan 22,  6:53pm)

Redirected to zsh-users ...

On Jan 22,  6:53pm, Andrej Borsenkow wrote:
} Subject: Re: Help on zsh grammar
}
} On Wed, 22 Jan 1997, Dietmar Rempfer wrote:
} 
} > Let us define the following function:
} > 
} > test () { echo \"$*\" }
} > 
} > Now, if I do ``test blabla'', I get "blabla", which is what I want.
} > But if I say e.g. ``test *.aux'', I would like to see "*.aux" printed out,
} > but instead I get the message: zsh: no matches found: *.aux.

You're getting that error before `test' even runs, from the top-level shell
that's parsing the command line.  `$*' is -not- being globbed inside `test'.

} What about 
}    test '*.aux' :-)
} 
} But really, you want
} 
}    unsetopt nomatch

No, he doesn't.  What he wants is

	test () { echo \"$*\" }
	alias test 'noglob test'

Note that the alias must come after the function definition, or else you
define two functions (`noglob' and `test'), both of which do the echo.
(You can use `function test () { ... }' instead, but it's still a good
idea to always define aliases after defining functions.)

-- 
Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern


       reply	other threads:[~1997-01-22 20:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.SV4.3.95.970122185019.1005B-100000@itsrm1.mow.sni.de>
1997-01-22 19:35 ` Bart Schaefer [this message]
1997-01-23  6:31   ` Hrvoje Niksic
1997-01-23  7:23     ` Bart Schaefer

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=970122113559.ZM3128@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=borsenkow.msk@sni.de \
    --cc=dietmar@sokrates.mae.cornell.edu \
    --cc=schaefer@nbn.com \
    --cc=zsh-users@math.gatech.edu \
    /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).