On Fri, 24 Mar 2000, jonathan wrote:
> Looks like that worked, must say I don't understand the quoting, but it
> seems to work, will find out at 0200 when the next backup runs. Thank
> you.
The reason the quoting worked:
> > find /backup -name 'data*' -atime +1 -exec rm -f {} \;
...is because the sheel sees the expression data* and expands it. Let's
say, for example that in whatever directory the current running shell
*happens to consider current* (not necessarily /backup, even), there is a
file called data1, data11, data3, and data.foo.bar.mumble. The line as
you had it would then execute as:
find /backup -name data1 data11 data3 data.foo.bar.mumble -atime +1 . . .
Reason: THE SHELL EXPANDS * EXPRESSIONS. By putting quotes around the
data* expression, or by escaping the * (e.g. data\*) you prevent the shell
from expanding the expression, and the expression gets passed to find the
way you wanted it.
tar and zip are the other examples that come immediately to mind where
this gotcha applies.
--
To unsubscribe: mail ">majordomo@ale.org with "unsubscribe ale" in message body.