From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8493 invoked by alias); 26 Feb 2018 20:44:40 -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: List-Unsubscribe: X-Seq: 23179 Received: (qmail 7053 invoked by uid 1010); 26 Feb 2018 20:44:40 -0000 X-Qmail-Scanner-Diagnostics: from kahlil.inlv.org 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(37.59.109.123):SA:0(-1.9/5.0):. Processed in 1.264605 secs); 26 Feb 2018 20:44:40 -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=BAYES_00,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: martijn@inlv.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Subject: Re: Please help me quote ! :) To: zsh-users@zsh.org References: <20180226175037.hgrrnft44wjx3so7@solfire> From: Martijn Dekker Message-ID: <835f7747-73fe-44c7-8106-5d480f943879@inlv.org> Date: Mon, 26 Feb 2018 20:36:19 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180226175037.hgrrnft44wjx3so7@solfire> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Op 26-02-18 om 17:50 schreef tuxic@posteo.de: > is there a way to automatically escape all "bad" characters > (like spaces) while expanding a shell variable containing a > "bad" filename? Yes. See 'man zshexpn' under the heading "Parameter Expansion Flags". The flag you need is the "q" flag. For instance, instead of $var, use ${(q)var}. See the man page for how to tweak the quoting format. HTH, - M.