#13 Find command with -exec option fails

open
nobody
None
5
2004-09-14
2004-09-14
Anonymous
No

-exec command is unable to work in the find command.
Always give me the error "find: missing arguement to '-
exec'", while the command works in CYGWIN
environemnt. My command:
find c:\temp -name readme.txt -exec cat {} \;

Discussion

  • Logged In: NO

    The problem i think is that you don't need to end with \; but
    just ;

     
  • Logged In: NO

    example:

    find -xtype d -exec c:\myprog.exe \"{}\" ;

     
  • Logged In: NO

    As has been mentioned, you're not supposed to escape the
    semicolon with a backslash.

    This is because you appear to be using COMMAND.COM,
    which--unlike zsh or some other Unix-type shell--doesn't
    handle (nor require) this notation.

     
  • Logged In: NO

    On Windows, you have to omit the backslash before the semicolon. Unfortunately, find seems to have have problems to work with filenames containing blanks...