From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6425 invoked by alias); 14 Mar 2012 19:48:16 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16884 Received: (qmail 15698 invoked from network); 14 Mar 2012 19:48:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_NONE, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at yahoo.fr does not designate permitted sender hosts) 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= X-Yahoo-Newman-Id: 338743.52861.bm@smtp143.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: VHeM8IMVM1mnb7bz_jKUwzj8Oe_XCDHxbvuqDIbVKczN81n C_lHvksxGPv0q95IukvtKBO6VjOemP4xX64hwxpXeo1mTriyDJ9bhOdUdThi siQU8p_GZdbcEvO8bU554M1oxPvamnPxn6BEYzK69ldKFZ4MtQQjN_bpS0wB Hie8ldPvdXK2acP.SYIcgO9uTKCfrNSBw4uDK7eu9zNdcqGfrsMXwTvrZHm3 jxyaPk4YxA3DieoMZmsGicdyg6JIEazLDg_.S_CSvQRJ3rbnKIBlt77_jtiJ dgjJnuIgjAM_XJ0PckvTXi5czGWdCVD636qL.5y357hfM6cvVY4.WPepKlCY n.YgW5gVySzhHe5KaO7djhugSWUUdD6tpdgXh_KZLz1UWTG3xPhU.xQG72Dx 9IffNKeg- X-Yahoo-SMTP: V1UR0WuswBDVD1eFhM33188Ir8ciBckz4W8ZMsAh Date: Wed, 14 Mar 2012 19:42:52 +0000 From: Stephane Chazelas To: Anonymous Cc: zsh-users@zsh.org Subject: Re: Why is this happening in zsh? Message-ID: <20120314194252.GD6799@yahoo.fr> Mail-Followup-To: Anonymous , zsh-users@zsh.org References: <3d1c765788f2c6b89b58beae6b318b54@foo.asia-king.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3d1c765788f2c6b89b58beae6b318b54@foo.asia-king.co.uk> User-Agent: Mutt/1.5.21 (2010-09-15) 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. -- Stephane