Solution for find(1) in 4.2BSD
Steve Wall
wall at ucbvax.ARPA
Sat Oct 6 17:34:11 AEST 1984
Apparently what I thought was a bug in find(1) was a syntax error
on my part in giving the command, although the error was pretty
obscure. find(1) **MUST** have a space between the "{}" and the
escaped ";" in order to work correctly. Some people suggested putting
quotes around the {}, but that still doesn't work unless you have a
space between the {} and the escaped ";". This is ***NOT*** made clear
on the manual page. Argh!
Here's a script with a few responses/suggestions and what they
produce:
===========================================
arpa % ls -RF
1/ 2/
1:
file_find
2:
file_find
> Try putting the {} in quotes so the shell doesn't expand it.
arpa % find . -name file_find -exec ls -l "{}"\; -->[NOTE: NO SPACE!]
find: incomplete statement
> don't combine the {} and the \; in the same token.
>
> find ...... -exec ls -l {} \;
>
> should do what you want.
arpa % find . -name file_find -exec ls -l {} \; --->[NOTE: THE SPACE!]
-rw-r--r-- 1 wall 0 Oct 4 06:46 ./1/file_find
-rw-r--r-- 1 wall 0 Oct 4 06:46 ./2/file_find
=============================================
Thanks for the responses,
Steve Wall
wall at ucbarpa
..!ucbvax!wall
More information about the Comp.unix
mailing list