Re: find files for user and chown them?



On Mon, 20 Mar 2006 15:31:18 +0100, Kai Schaetzl
<ng@xxxxxxxxxxxxxxxxx> wrote:
Chris F.A. Johnson schrieb am Sun, 19 Mar 2006 22:00:24 -0500:

Then show us what you are using so we can see whether you are
using the correct syntax or not.

find . -user whoever -exec chown someone:somegroup {} \;

Thank you both for the correct syntax. I tried without the escape
slash. Actually, I read about escaping in man, but I did it the wrong
way and tried it for the {}, not for the semicolon. As I understand
the semicolon shows find the end of the -exec command, I didn't expect
it to find it with an escaped semicolon as well. As I understand the
escape is for bash and find gets the unescaped semicolon to "see"?
Doesn't ";" just terminate a shell comand line, anyway, so this
shouldn't make a difference?

This should make it clear:
echo ;
semicolon ends the command

echo \;
semicolon is an argument

echo \; date ; date
the first date is an argument, the second is a command.

--
Expense Accounts, n.:
Corporate food stamps.
.



Relevant Pages

  • Re: find files for user and chown them?
    ... Thank you both for the correct syntax. ... I tried without the escape slash. ... As I understand the semicolon shows find the ... to break up long lists into chunks that ...
    (comp.unix.shell)
  • Re: How to through a semicolon separated list in a string
    ... >>a semicolon separated list of entries. ... what does the slash after the echo and the tilde ... I read that && is a conditional continuation (only ... & simply a distinct command separator (which is what unconditional ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: abs-guide: command separator and syntax
    ... echo "File $filename not found."; ... fi; echo "File test complete." ... Notice the emphasis on the space after the semicolon. ...
    (comp.unix.shell)
  • Re: Variables containing regular expressions
    ... Well let's see how my toes are doing... ... $ echo find ./ ${ARGS} ... and that find is seeing an escaped semicolon rather than a semicolon. ...
    (comp.unix.shell)
  • Re: abs-guide: command separator and syntax
    ... echo "File $filename not found."; ... Notice the emphasis on the space after the semicolon. ... hoc tests with ksh, zsh, bash, on Cygwin did not show any problem.) ...
    (comp.unix.shell)