From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6516 invoked by alias); 13 Mar 2014 15:23:29 -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: 18605 Received: (qmail 2208 invoked from network); 13 Mar 2014 15:23:22 -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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1394723863; bh=biE209HAb/D76RaOqX7ktKs6s/IWZ1W33/BsLeR6cUk=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=B2uB9JMlzTE3OlZ/wVft6eEbyS/f8UBTR8B5ff+e8iRPMLeueLDZfESw8qsmQEToAN3VDc8WAtIAbytf9KQ4pzXEB1dcplYOJrleCo6KONxC8U1ngo/9624eUZeSsBP8RkwHuGBdMgKz+0ENnLTjK/0FOax1AKF4VajdxpUskPg= X-Yahoo-Newman-Id: 497304.99306.bm@smtp120.mail.sg3.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: SqjM0PkVM1lTUqKMPUrPPe9OdAxUJlTAU_gDQ271ZVJTjGk jEfD3J6QX4iI4Huh8_EluoyPspdXjwwewsRczESnkmLehndIAINNbLibj9N7 0qyQ6fS6kLob9wy8GlW3uLw9sRmLln_p7rNelZSCQ9s3vwim7LmJDPQtVsBO iexHw4h.o6NVJap2ipiCeeuru5zYf_3leHqqSgA8LIlI6CYwLqZqNIzusjWS vz9etqNO4UzveMU.64OZt1YHJMFXI9HapZQeDg1gpIMv._tOE4kz7uYJxNNI k_ZxW59vcO61fEvX4MhMVhz_42F._HNpb8wqqrVIMuTe1ADURVS8Kt4Qbdl1 wA72rxv9FcHVAbZFGIngHTOi2HuzmD8mnGVfLdzNDYkP.BQ11nwur2lhekiJ tphmfZTB75HODXTPNH2LHdeKb8QPvmQJPRYpX3HWtIfGKTj4MBBN7gfi30BO qN5wFiPGEUvfeMEcpTAHV2t5lW3MjvH69ydOC_UZNVa23AgXZD3sNWIw0IQM bYk9ZNBZZEAUUOBrdj9mWwxbr1Ax8crVV_eNQCp26me.WZbwH37Dv_Q-- X-Yahoo-SMTP: JFuGfEmswBAJxZtns.VSD4UvEHQ- X-Rocket-Received: from localhost.localdomain (ammdispose-zsh@59.182.187.254 with plain [106.10.150.171]) by smtp120.mail.sg3.yahoo.com with SMTP; 13 Mar 2014 15:17:43 +0000 UTC Message-ID: <5321CC16.30606@yahoo.com> Date: Thu, 13 Mar 2014 20:47:42 +0530 From: Amm User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: zsh-users@zsh.org Subject: Re: noglob does not call alias? References: <1394700750.34719.YahooMailNeo@web194603.mail.sg3.yahoo.com> <197551394709878@web5h.yandex.ru> <20140313123811.GH26446@localhost.mi.fu-berlin.de> <140313073641.ZM14350@torch.brasslantern.com> In-Reply-To: <140313073641.ZM14350@torch.brasslantern.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 03/13/2014 08:06 PM, Bart Schaefer wrote: > However, aliases defined without -g are only expanded in the command > position (occupied by "noglob" in the original example) OR when the > word in command position is itself an alias ending in a space. > So the original complaint can be resolved by > > torch% alias noglob='noglob ' > torch% noglob rm ? > not removing ? This works if alias rm='rm -i' but gives error if I have these: alias rm='nocorrect rm -i' alias noglob='noglob ' $ noglob rm 1 zsh: command not found: nocorrect As I already said in my previous e-mail that, zsh needs to consider noglob and nocommand as special case and treat the next argument as alias as well as command. (not just command) Then we will not need the workarounds like create a rm() function or create alias noglob='noglob ' > > } Why did 'rm *', resulting in 'noglob rm -i *' still execute ??? > } > } I assume, the handling of 'denied' case of 'rm *' ends with > } a still existing parameter to 'rm', and thus runs the command > } instead of ignoring it completely? > > That's correct. The handling for "rm *" actually walks through the > argument list and asks once for every "*" or word ending in "/*" and > if the answer is no, deletes it from the argument list and moves on > to the next one. So "rm * * *" will prompt you three times. > > If arguments remain after that, the rm is executed. Asking 3 times make no sense! I think purpose of this 'rm *' special handling is to prevent accidental file deletion. (due to accidental addition of * in arguments) So if he typed: rm * 1 2 3 And then zsh warns me and then I said "Oh, no I dont want this! And answe no". It obvious I made a mistake, So rm should NOT be executed at all (even if there are arguments remaining) Let him first manually delete '*' from command and execute rm again. Amm