From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4591 invoked by alias); 3 Sep 2015 17:11:54 -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: 20505 Received: (qmail 23887 invoked from network); 3 Sep 2015 17:11:51 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Authority-Analysis: v=2.1 cv=T/C1EZ6Q c=1 sm=1 tr=0 a=W9UYH+FrKn4AXTMgefo3uQ==:117 a=W9UYH+FrKn4AXTMgefo3uQ==:17 a=IkcTkHD0fZMA:10 a=E8Ce53p-aPCjRSL9xtQA:9 a=QEXdDO2ut3YA:10 Message-id: <55E87F55.9020307@eastlink.ca> Date: Thu, 03 Sep 2015 10:11:49 -0700 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: string to array space problem in filenames References: <20150821215037.6b010cf7@ntlworld.com> <55DFC1E6.5090400@eastlink.ca> <55E0AE60.9090706@eastlink.ca> <150828124334.ZM7129@torch.brasslantern.com> <55E7C084.2060505@eastlink.ca> <150902222539.ZM18111@torch.brasslantern.com> <55E86605.7080304@eastlink.ca> <55E8711A.2040004@eastlink.ca> In-reply-to: <55E8711A.2040004@eastlink.ca> Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit On 09/03/2015 09:11 AM, Ray Andrews wrote: > On 09/03/2015 08:30 AM, Mikael Magnusson wrote: > > > Ah, one more thing: > > input=( ${(f)"$(<~/.dirstack)"} ) > > ... as Bart showed, works fine, however the function that does the > sorting and > compressing I like available for other things, so I want to be able to > use > an argument there. While I was using the 'single line' version, like > this: > > input=(${=@}) > > ... and the function itself called like this: > > compress_function `cat ~/.dirstack` > ... but it no longer works with the 'newline' form. So how do I take > input > from an argument now? > > Therewego: compress_function `cat ~/.dirstack` ... is moronic. compress_function ~/.dirstack ...to pass the filename, and: input=( ${(f)"$(<$@)"} ) ... to grab the contents of the file. I won't say it's simple, but it sorta makes sense.