From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22789 invoked by alias); 28 Aug 2015 02:35:34 -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: 20472 Received: (qmail 4872 invoked from network); 28 Aug 2015 02:35:32 -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=N659UExz7-8A:10 a=NI5h7Cz67RzZ_18Wz7gA:9 a=pILNOxqGKmIA:10 Message-id: <55DFC1E6.5090400@eastlink.ca> Date: Thu, 27 Aug 2015 19:05:26 -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: string to array space problem in filenames References: <20150821215037.6b010cf7@ntlworld.com> In-reply-to: <20150821215037.6b010cf7@ntlworld.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit Gentlemen: I should probably know this, but I'm rusty after a few months not thinking about zsh. I have a personal implementation of a dirstack that just pushes $PWD to the end of a file then rereads the file to an array which is then sent to 'select' to let me change directory. I like it because it survives reboot and works across xterms and removes duplicates and so on. The only thing that trips it up is when a directory is pushed that contains a space. I have few of those, so it's just an irritation, still I'd like to fix it if possible. Here's one of the offending directories: pts/1 HP-w5--5-Debian1 root /root/.icedove/Ray/Mail/Local Folders ... which 'select' does this with: 1) QUIT 2) /aWorking/Zsh 3) Folders 4) /root/.icedove/Ray/Mail/Local ... because it breaks at the space, obviously. Is there some way around that? I've tried various quotes and slashes and incantations and spells, but no luck. I expect that 'select' can't be expected to behave differently so somehow the array needs to know to protect spaces in directory names. I'm fuzzified why protecting them with quotes doesn't do it.