Re: [SLUG] Q: Fileglobbing with whitespace escaping (in bash, zsh, or any other shell you prefer)?'

From: btt@nethouse.com
Date: Thu Apr 25 2002 - 22:06:47 EDT


On Thu, Apr 25, 2002 at 09:20:16AM -0400, Ben Ostrowsky wrote:
> What am I doing wrong here? The subdirectories of the context in which
> it's executed have spaces in their names, and bash is trying to cd to
> each word in the directory's name separately, so I get something like:
>
> No such directory 'Attack'
> No such directory 'of'
> No such directory 'the'
> No such directory 'Clones'
>
> Here's my code:
>
> #!/bin/bash
> for i in `find -type d`; do {
> cd \"$i\" ;
> echo Changing directory to \"$i\" ;
> ls -al ;
> # bladeenc -br 160 -prio=normal *wav ;
> cd .. ;
> }
> done;

You could set IFS=\n so that newline becomes the field delimiter.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:41:00 EDT