From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9461 invoked by alias); 24 Jan 2017 16:03: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: 22416 Received: (qmail 9424 invoked from network); 24 Jan 2017 16:03:43 -0000 X-Qmail-Scanner-Diagnostics: from mout.gmx.net 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(212.227.17.20):SA:0(-1.9/5.0):. Processed in 1.140095 secs); 24 Jan 2017 16:03: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=-1.9 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: llua@gmx.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at gmx.com designates 212.227.17.20 as permitted sender) Subject: Re: Avoiding the zshells intelligence...in one case To: zsh-users@zsh.org References: <20170122080153.GA5042@solfire> <213742a3-d208-973d-3b86-1ac29b9d96dd@eastlink.ca> From: Eric Cook Message-ID: <2f69cfec-46e2-1a93-101d-fb0579d0637f@gmx.com> Date: Tue, 24 Jan 2017 10:58:19 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <213742a3-d208-973d-3b86-1ac29b9d96dd@eastlink.ca> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:PYTJdH1AHPbHbaIy1UpKyieDGDnKs9CAmyHX4sJpzkoLl2PD2Y5 AXw/9MPm2oQ1CSMcGex/7yz+El915TFTwFCjGamdxWIN0JaL38t3USKeKlvCpa84qR82N0N pfHHlK0VBHuw93ipodd4bAsCenV7fVYClDhhn7pzzPspfSiCupPv390jqylwIHPicqekUt6 rkM8KHqroMR/BeOR29BOQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:ieLrkcrLRKY=:TiI9ASjWUNawoE0j/Jt/2+ 2Trg+gIFYuCoweWL1RO+NXtEsyXwMysqcu8emtKlIT5WGXwdiNq6IUvc+Q0C8ei0JISoudAbF VxeBVjUqdR2Hmp6xpdGTYmN6Du0n5fzHMlhqlIl70u0eVFRzradxlIni46UBbexTv8ru8MOK0 ME/PwHQeeZ+/jsMhtObmea4LC413TW24Duhcw5l+FVAvG4L+y7TeJRsoeIMlRdlMfSwHnwDwv /FUtSc2jkmkAMEOoZvin5Ilf4RK5Zkxqes1dab/PMx5EcxkGgce1t5FV46OsIcrJY7iGc7NNb N2X2LiZ1Yo7KFamf0Svpgh0aLI0vGgeW4E6STQngCCftXfqdynA0c7FMsHwbZre0SyWyRWUmt FlvHX1R6Lq7ikh3srzmI02bJZ5eEi/6gXoJr1lWkmrVM6N4QWysSsk9ahJpHlAtK5fsCd0hPX F9n4yO/+CmfsWcHRj20igpKQAmjhJ3JTsq5demTxg9lRATKeLtnuBbwQN4mJqYMNgh4r32yxT VN/Pej4rXak0ECzxgz/Fmkc0/5xbucgVxp1W4d/4MTgLG1mttVzg0aFxNeptueXo66Cr1O1x7 haYsN9cYV6DitG9lF1wgXLoi7Ni+Y/FeLQQK2Z0IsW6CT+dQ90KSs2RETTbcqMgMdOuX50ZCU SJAI3eqqZp1l/j4E8Bl607nATPSJvFOcJRc2FVoYXywNngi1AlUc/JBCqsjBogkbJu0c8maIs CFshdNl79NbpgcSyq++TvTDeaAG+aiBAbVdiBambxtYNttuogscKwd1Enm/jtSNjnc65kLVZG nD9ZtVM On 01/24/2017 12:42 AM, Ray Andrews wrote: > On 23/01/17 06:48 PM, Eric Cook wrote: >> >> That the point of having single quotes, so nothing within them would be treated syntactically. >> This thread is just another plead at being even more lazy, to not have remember to use an >> option/syntax to treat a string literally. >> > Except that that doesn't work with command line arguments nor with things like: > Except that it does. > $ alias junk='echo $path' > > $ alias wense='whence -m "$1"' And does so during both of those alias definitions, you may be confusing what happens during the definition of the alias and what happens during the execution of the alias. Running: % alias -L Will show you that both alias were defined exactly as you inputted them, because the single quotes prevented the expansions And ignoring the expansions of the commandline, the original poster used an url that contains an ampersand; & isn't an expansion, just other shell syntax that a noglob-like option or bart's current attempts will not be able to disable. % curl -s http://site?param&disown Can be a legal site url, but could also be meant as a curl command to be ran in the background and disown that process. short of reading the user's mind how would you make it easier? prepending noglob is already two more characters than '', then you would need an `nosyntax' like command to deactivate &. I get that shells, unlike other programming languages are used far more interactively and that less typing is normally always good. But in nearly every other programming language if you don't want the syntax/metacharacters to be treated specially, you escape/quote them correctly. I just don't see how remembering to use an alias/option is less inconvenient than remembering to use single quotes on strings with questionable characters. hell, with recent versions of zsh with bracketed-paste you could copy and paste this entire email into your shell, invoke the quote-line widget, then prefix print -r -- and have a command that will work anywhere regardless of the options set (rcquotes being the sole exception) or alias/functions that the user may have.