From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24838 invoked by alias); 24 Jan 2017 18:51:37 -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: 22417 Received: (qmail 23306 invoked from network); 24 Jan 2017 18:51:37 -0000 X-Qmail-Scanner-Diagnostics: from mta03.eastlink.ca 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(24.224.136.9):SA:0(-3.9/5.0):. Processed in 0.74472 secs); 24 Jan 2017 18:51:37 -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=-3.9 required=5.0 tests=RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: rayandrews@eastlink.ca X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.eastlink.ca designates 24.224.136.9 as permitted sender) X-Authority-Analysis: v=2.2 cv=DOfN2GFb c=1 sm=1 tr=0 a=28Ntk8jg+Dho8ABWn/CRtA==:117 a=28Ntk8jg+Dho8ABWn/CRtA==:17 a=N659UExz7-8A:10 a=LZD-iEJLER8O_rPqSqgA:9 a=pILNOxqGKmIA:10 X-EL-IP-NOAUTH: 24.207.16.108 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> <2f69cfec-46e2-1a93-101d-fb0579d0637f@gmx.com> From: Ray Andrews Message-id: Date: Tue, 24 Jan 2017 10:21:28 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 MIME-version: 1.0 In-reply-to: <2f69cfec-46e2-1a93-101d-fb0579d0637f@gmx.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 24/01/17 07:58 AM, Eric Cook wrote: > 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 Sure, but if we have any chains -- one command calling another -- we end up loosing the quotes as things are passed along. > 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. And that's just what I'm saying -- it would be nice to have some sort of bomb-proof zero expansion ability. > > % 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 &. My suggestions are really questions in disguise, it's interesting to consider how any of this could really be done. All I know for sure is that half or more of my own troubles with zsh have been efforts to stop expansion of one thing or another, or to protect some character from being interpreted or stripped out. > > 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. Not convenient, that's hardly the point. More like predictability and robustness and transparency. FWIW I've always thought that terseness in code is a false virtue since it isn't typing that slows us down, but design and debugging and -- where terseness is the rule -- just studying up on the correct syntax can take a thousand times longer than the actual keystrokes. > > 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. True, there's almost always a way. Seems the only thing that's impossible is passing a command's literal arguments to the command, tho noglob is at least a partial cure for that. But, as time goes by, I confess that more and more I see the virtues of zsh's way of looking at things, but I do like pondering alternatives. > >