On 25/06/11 08:05, David Jardine wrote:
>    $ mkdir newdir; cd newdir
>    $ touch 'one space' 'and two spaces'
>    $ for jim in *; do echo $jim; done
>    and two spaces
>    one space
> 
> So far, so good, but:
> 
>    $ for jim in `ls`; do echo $jim; done
>    and
>    two
>    spaces
>    one
>    space

I don't understand why you'd use that method. If you do need to use that
approach "$jim" might be better (for other uses).

Try:-
$ ls -Q
"and two spaces"  "one space"

Or if the long route is required :-
$ ls -1Q | while read jim; do echo "$jim" ; done
"and two spaces"
"one space"



Cheers

-- 
I'm tired of this back-slapping "Isn't humanity neat?" bullsh#t. We're a
virus with shoes, okay? That's all we are.
~ Bill Hicks


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4e056ded.8030...@gmail.com

Reply via email to