From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23870 invoked by alias); 28 Aug 2015 20:42:24 -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: 20480 Received: (qmail 1344 invoked from network); 28 Aug 2015 20:42:21 -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=X+5rdgje c=1 sm=1 tr=0 a=W9UYH+FrKn4AXTMgefo3uQ==:117 a=W9UYH+FrKn4AXTMgefo3uQ==:17 a=N659UExz7-8A:10 a=RxM-oI_fDVtBptrgO4cA:9 a=pILNOxqGKmIA:10 Message-id: <55E0C7AA.9090900@eastlink.ca> Date: Fri, 28 Aug 2015 13:42:18 -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> In-reply-to: <150828124334.ZM7129@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 08/28/2015 12:43 PM, Bart Schaefer wrote: > Your first problem here is trying to maintain .mydirstack all as one > line (echo -n) with spaces between the fields. You would be much > better served by writing one file name per line and then splitting > the file on newlines when reading it back. > > Out: > echo "$PWD" >>| ~/.mydirstack > In: > mydirstack=( ${(f)"$(<~/.mydirstack)"} ) > > Then you should be able to do > > select dir in "${mydirstack[@]}"; do something with $dir; done > > If you insist on storing it all on one line, Heck no, I don't insist on anything. The single line thing was the only way I could get it to work, but the above sounds very much better even on first reading. I'm still lacking free time, but I'll play with that and get back to you. Thanks as always Bart.