On Thu, 19 Sep 2002, Steve Buehler wrote:

> Thank You for the reply.  It never hurts to keep learning.
> 
> Steve
> 
> At 11:24 AM 9/19/2002 -0400, you wrote:
> >the {} is a placeholder for the pathname of each file found
> >
> >for some reason, commands need to be ended with an escaped semicolon...
> >
> >kristina
> >
> >On Thu, Sep 19, 2002 at 10:10:45AM -0500, Steve Buehler wrote:
> >- Ok.  I found another way of doing it.  Since chown does not appear to work
> >- the way the "chown --help" says that it will.  I now run this find command:
> >- find ./ -user ryukyu -group settlers -exec chown skb.skb {} \;
> >- Now, can someone explain to me what the "{} \;" part of the command does/is
> >- for?  It won't run without that part and I can't find anyplace that tells
> >- me what it is for.

as the previous poster explained, the {} represents the name of the
file that was just found that matches your search criteria.  the
reason it's used is because you might want to execute a command that
requires the file name in more than one place, such as:

  ... -exec cp {} {}.bak \;


in addition, any -exec portion of a find command needs to be escaped
with *one* *of*

  \;
  ";"
  ';'

to show the end of the -exec part, since it's possible to have more
than one -exec clause, as in:

  ... -exec ls -l {} \; -rm -i {} \;

rday

p.s.  both of those features are in the man page for "find", under
the ACTIONS subsection, where -exec is documented.


Robert P. J. Day, RHCE, RHCI
Eno River Technologies, Chapel Hill NC
Unix, Linux and Open Source corporate training

http://www.linux-migration.org



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to