From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7921 invoked by alias); 1 Nov 2014 18:40:45 -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: 19303 Received: (qmail 23538 invoked from network); 1 Nov 2014 18:40:32 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Originating-IP: [80.3.229.105] X-Spam: 0 X-Authority: v=2.1 cv=RdIeCjdv c=1 sm=1 tr=0 a=uz1KDxDNIq33yePw376BBA==:117 a=uz1KDxDNIq33yePw376BBA==:17 a=NLZqzBF-AAAA:8 a=kj9zAlcOel0A:10 a=vU8FyQ7zFdiCj3q99vMA:9 a=CjuIK1q_8ugA:10 Date: Sat, 1 Nov 2014 18:40:28 +0000 From: Peter Stephenson To: Zsh Users Subject: Re: first adventures Message-ID: <20141101184028.0737142d@pws-pc.ntlworld.com> In-Reply-To: <54550BE5.6080602@eastlink.ca> References: <544D2D6F.8030505@eastlink.ca> <20141026175257.2611487b@pws-pc.ntlworld.com> <544FD6DD.7010806@eastlink.ca> <141028210510.ZM10784@torch.brasslantern.com> <54510A96.20009@eastlink.ca> <141029134624.ZM15681@torch.brasslantern.com> <545178DF.1040600@eastlink.ca> <141029210738.ZM15833@torch.brasslantern.com> <5452ED18.7070208@eastlink.ca> <141030195906.ZM30057@torch.brasslantern.com> <5453D0AE.6020705@eastlink.ca> <20141031195903.167d3e05@pws-pc.ntlworld.com> <545460D9.2090804@eastlink.ca> <54550BE5.6080602@eastlink.ca> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 01 Nov 2014 09:35:49 -0700 Ray Andrews wrote: > But there are > situations where I have to pass a literal ' \n ' to a command, so I was > wanting it unmolested. Is there, or > could/should there be some way of leaving builtin 'special' characters > alone? That's exactly what quoting is for. '\n' is probably the easiest way of doing it. Single quotes quote everything except single quotes (and with RC_QUOTES you can do that, too). > Philosophically tho, it seems strange that zsh can prepare coffee in > more ways than Starbucks, but getting a raw coffee bean is difficult. This isn't fair in this case. The character \ was picked to be a special character because it isn't commonly used in normal text. So it's special to the command line. You now need it to be special somewhere else *as well*, at a later stage, for something that also picked the backslash to be special for exactly the same reason. It's not surprising that takes a bit of doing. With your analogy, you're trying to put a coffee bean into a roaster and saying that you want it to emerge unscathed in such a way that it can be roast by something else after it emerges. If you want text not to be processed by the shell, the best way of doing that is to pass it via standard input and output rather than the command line, using "read -r" and "print -r". pws