From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18772 invoked by alias); 16 Sep 2016 00:35:43 -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: 21927 Received: (qmail 8610 invoked from network); 16 Sep 2016 00:35:43 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f182.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.192.182):SA:0(0.0/5.0):. Processed in 0.489145 secs); 16 Sep 2016 00:35:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=EmLDP4T25+VnhCUlDZ6tdqURxwim+r+sCgizHCvHFZI=; b=Q/OaCh5X/o9guiuXKGge7+LvMQpVhwmTGWSwRhD+HqniBX+tDXrcjT2I6Y/f58ajlA nWSQ09vlz9XFvnk0fjVMH+7UvZ6HmlmmvrA8+ibXk1sOjyfofxlChFnXQ8TxuPOI1+VX E0yVsY4mX1f8rKkaPX9OK9uuvGWQJ3h1YyEMZD16zg9h6Q8YTQU2KCJOYPIDhJdU1H81 PU0fh2nwhNBwVZ9rDGu/wf20k128nd8ijWDp+fvYQbxZj37SX4ziCrmayCv5YBV8Q032 FHNLeRp8Tn9OC1iThQSOD/9anZ2TKH112MSbik0DHaz2iWIN4QNK8MjyrFZKdvt09yqV 50lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=EmLDP4T25+VnhCUlDZ6tdqURxwim+r+sCgizHCvHFZI=; b=TrlWgKYIfOktXfWNbU0TWHQY2v8Bee7XvUDwvPV3Q/DRIoy8FA/iU6nncfUuq6XsLn EJxY85lghC/L+0+BUBLtKGBdUuKqI27nj23UfxXF4sKD0iE5pr4RhgwyCL7XlJHjy++6 3pTgmb5xiyNAg3jp1eJZMlDpGVub5FIHYjf0oT5k+YofRP0muH17hAE4B9Cx8cdSfLX4 cyfndzFqMyEWWfgBExq48eaLOlVxSABPJ0qDXzaKKSzOT76k1RC8u57bZTDow7cnJfTV nLvka9Oq1rreuD+IzZuTd2hcT8u3df3RK5w6nU4RgECcXX9w3kJTIJwf6IZDUzxUZ6P/ oj6g== X-Gm-Message-State: AE9vXwPGMEeDNhgZSYQBxzpfPN3vI895TmFJPNSg0sycN+3XrQYNboo+LE7EvXa2pmFu9w== X-Received: by 10.98.17.83 with SMTP id z80mr18778398pfi.38.1473985795474; Thu, 15 Sep 2016 17:29:55 -0700 (PDT) From: Bart Schaefer Message-Id: <160915173009.ZM3818@torch.brasslantern.com> Date: Thu, 15 Sep 2016 17:30:09 -0700 In-Reply-To: <58b1b8df-7946-ba27-342f-d842dabd691d@nxvr.org> Comments: In reply to zv "Re: Treating alias or function arguments literally" (Sep 15, 4:20pm) References: <58b1b8df-7946-ba27-342f-d842dabd691d@nxvr.org> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: Treating alias or function arguments literally MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 15, 4:20pm, zv wrote: } Subject: Re: Treating alias or function arguments literally } } I have already declared this function `noglob' & `nocorrect' This doesn't mean what you think it means. Placing "setopt noglob nocorrect" *inside* a function DOES NOT affect how the arguments of that function are interpreted. Globbing occurs as part of command line parsing before the function even begins to execute. The point of alias calc='noglob calc' is to tell the command line parser not to perform globbing on that command line, which will then protect the arguments. } (I just checked with an alias and that doesn't effect it either) In fact in my own .zshrc I have (dating back years to before zsh had floating-point math in $(( )) expressions): calc () { awk "BEGIN {print $*}" < /dev/null } alias calc='noglob calc' And it works exacly as intended: schaefer<501> calc 4*3 12 schaefer<502> calc 20*15/2 150 schaefer<503> So ... what alias are you using that doesn't work? Note that you have to assign the alias *after* defining the function, or weird things will result (see the FAQ).