On 10:00 02 Mar 2002, Andrew Smith <[EMAIL PROTECTED]> wrote:
| > However, this can all be reduced even further:
| >     find /home2/Temp/Test -type f \
[...]
| >             \) -print -exec rm -f {} ';'
| 
| make the last line:
|               \) -print -exec rm -f '{}' ';'
| 
| If you don't do this the script WILL DELETE any files
| that match the beginning of a filename you want deleted
| but that contains a space in it (since the choice was "rm -f")

NO.

You are TOTALLY wrong here. You have obviously never tested this.

The arguments to -exec ARE NOT handed to the shell for interpretation and
subsequent dispatch, they are passed directly to execv, and ARE NOT suject
to space interpretation at all, nor any other kind of quoting issue.

Furthermore, if you imagine that quoting an argument to "find" somehow
magicly passes some quoting to what find _does_ then you have a deep,
fundamental, misunderstanding of the shell and how things work.

Please DO NOT post untested misinformation like this to the list -
you will only confuse everyone.

Clue: _regardless of whether you put
        '{}'
or
        {}
in the argument list to find, the "find" command will be handed a simple
string: "{}" (without the quotes). Quoting is _purely_ a shell concept,
and commands do not receive "quoted" and "unquoted" strings; they just
receive strings. Quoting in the shell just governs how the shell decides
what those strings are.

Here, go read this:

        http://freshmeat.net/articles/view/337/

Until you understand the core point of this article, you will continue
to misunderstand quoting and how things work.

Cheers,
--
Cameron Simpson, DoD#743        [EMAIL PROTECTED]    http://www.zip.com.au/~cs/

Those who do not understand Unix are condemned to reinvent it, poorly.
        - Henry Spencer @ U of Toronto Zoology, [EMAIL PROTECTED]



_______________________________________________
Seawolf-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/seawolf-list

Reply via email to