Zsh Mailing List Archive
Messages sorted by:
Re: Why is this happening in zsh?
- X-seq: zsh-users 16884
- From: Stephane Chazelas <stephane_chazelas@xxxxxxxx>
- To: Anonymous <remailer@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: Why is this happening in zsh?
- Date: Wed, 14 Mar 2012 19:42:52 +0000
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.fr; s=s1024; t=1331754173; bh=Cru89BsqQTBKMH1s+gNldNsnzS8nYXTn+pQ1jLm2NGY=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent; b=cbbBHdzeOqFBn1dyiwIb5zVKs/sZliWPfaU+RJcSjnInf0+XdYI7m0vAB9yYLSy1E/veFj/Nof3t94p/Qv/kyTtRr0Qx9firZHoP7sCLY/LX3REPufxW4PC68vmgzt2Uc9LN6mycIA9SzfkI7DrHShf9eZfEFOqlJuSTZOIRpPQ=
- In-reply-to: <firstname.lastname@example.org>
- List-help: <mailto:email@example.com>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mail-followup-to: Anonymous <remailer@xxxxxxxxxxxxxxxxxxx>, zsh-users@xxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <email@example.com>
2012-03-14 19:59:02 +0100, Anonymous:
> I am moving away from Bash to zsh and I have one problem that keeps coming
> up. Somehow zsh is interfering in interpreting commands and I know there
> must be an option to stop this but I can't figure which one to use. An
> example is
> fossil --ignore *.class
> zsh: no matches found *.class
> fossil never receives the command at all
> I also have problems sometimes with rsync and have to use Bash. zsh is
> trying to substitute things that are supposed to be passed to the
> command. How can I set zsh to always ignore these without breaking something
> I haven't though of maybe like rm *.class
I think that maybe one thing you don't realise is the buggy
behavior of *other* shells.
Other shells do expand *.class as well before calling the
command, except that when *.class doesn't match any file, they
pass the string "*.class" unmodified to the application (and the
application will usually fail because they can't find a file
called "*.class", though in this very case I suspect it's the
other way round).
That is generally harmless, but in cases like:
rm -f [a-z]*.class
If there's no file matching that pattern, zsh will not run the
rm command, but other shells will tell rm to delete the file
called '[a-z]*.class' and since the [a-z]*.class pattern doesn't
match the '[a-z]*.class' file, that file may very well exist and
be deleted accidentally.
There are a number of options to change zsh behavior in that
regard, but I wouldn't do that.
In this very case, zsh behavior is helpful because it reminds you
that *.class is a globbing pattern and should be quoted if you
don't want it to be expanded (as I suspect). While in other
shells, *.class will silently be left untouched if there's no
class file in the current directory letting you overlook that
pending bug for when that script will be called from a
directory that has class files.
Messages sorted by: