Hi all,
I am trying to execute the following command:
find 'path' -ls -exec cksum {} \;
As you can see this simply finds files from a given path and runs cksum on them.
My problem is this, if i have a FIFO in a directory the find tries to execute cksum on it and gets stuck.
From the man page i understood that i cannot use -type and -exec together
so i am quite stuck here.
any ideas?
The man page of which OS gave you that idea? I just checked on HP-UX and Linux, and neither -type nor -exec are mentioned in the description of the other. Just try it.
Thank you for answering,
It is possible to use them together but when you use them together it is undefined who goes first. Sometimes first the type will be checked and then the exec activted and sometimes the other way around.
---------- Post updated at 06:53 AM ---------- Previous update was at 06:52 AM ----------
the solaris man page.
Solaris 5.10
---------- Post updated at 06:54 AM ---------- Previous update was at 06:53 AM ----------
Using -type is not sufficient to restrict the type
of files on which the -exec command operates, because there
is an inherent race condition between the type-check per-
formed by the find command and the time the executed command
operates on the file argument.
The exec will be done depending on its place in the command. If you put it after the directory, filename, and type, etc. then it will after those are evanulated.
I've never experienced where the order is "underfined".