[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash and variable holding directories with spaces



Michael Marsh wrote:
> If I understand the behavior you want correctly, then
> DIRS="'/cygdrive/c/Documents\ and\ Settings /cygdrive/d/My\ Data'"
> works for me.
> 
> This also works for constructions like
> DIRS="'$dir1 $dir2'"

Okay, but this doesn't work:

$> ls -nl file*
-rw-------  1 1000 1000 0 2005-12-03 16:56 file 1
-rw-------  1 1000 1000 0 2005-12-03 16:56 file 2

$> DIRS="'file\ 1 file\ 2'"; ls -ln $DIRS
ls: 'file\: No such file or directory
ls: 1: No such file or directory
ls: file\: No such file or directory
ls: 2': No such file or directory

$> DIRS="'file\ 1 file\ 2'"; ls -ln "$DIRS"
ls: 'file\ 1 file\ 2': No such file or directory


I guess I am missing something here.
->HS




Reply to: