Please do not use [QUOTE] tags except to quote from other messages. It makes it hard to quote you in a reply. Use [CODE] ... [/CODE] tags instead.
Quote:
Originally Posted by timl
Code:
find /mnt/doco/Docs/Resume -mtime -1 -exec cp {} /mnt/doco/Docs/Resume/goldy/ | rm {} \;
|
What do you think that pipe symbol is doing? It causes the shell to split that line into two separate commands, with the
find command ending (incompletely) before the pipe symbol and the rest of the line being treated as a separate command removing a nonexistent file named "{}". If you want
find to execute two external commands, both constructs have to be complete and end with "\;"
Code:
find /mnt/doco/Docs/Resume -mtime -1 -exec cp {} /mnt/doco/Docs/Resume/goldy/ \; -exec rm {} \;
The
rm command will be executed only if the
cp succeeds. That could also be done by telling
find itself to delete the file:
Code:
find /mnt/doco/Docs/Resume -mtime -1 -exec cp {} /mnt/doco/Docs/Resume/goldy/ \; -delete
(Either one is a near-equivalent to a
mv command.)
If you really meant that "|" to be a pipe, why would you be piping the stdout of
cp (which does not write anything to its stdout) to the stdin of
rm (which does not read from its stdin)?