[Top][All Lists]

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

Re: ARRAYS, SPACES and '"'

From: Paul Jarc
Subject: Re: ARRAYS, SPACES and '"'
Date: Mon, 27 Aug 2001 17:03:49 -0400
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7

address@hidden wrote:
>               for a in `find /tmp/bla -iname "*.mp3" -printf "\"%f\" "`; do   
>         echo "'$a'";            done

The expansion of the find command is subjected to word splitting,
since it is unquoted.  The quotes printed by find are just output
text, not syntactic quotes, so they cannot change the word splitting.
This will do what you want:
for a in /tmp/bla/*.[mM][pP]3; do echo "'$a'"; done

>               tmp=`find /tmp/bla -iname "*.mp3" -printf "\"%p\""`;            
> echo "tmp='$tmp'"

In this case, the expansion is not subjected to word splitting, even
though it is unquoted, because it is part of an assignment.

> #     Is this a bug or a feature?

A feature.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]