![]() |
find /common -name lost+found -prune -or -name fileTofind -print
Hya,
Question Why do these two commands return different result? Code:
>find /common -name lost+found -prune -or -name fileToFindCode:
>find /common -name lost+found -prune -or -name fileToFind -printQuote:
Debian wheezy, AMD64 current. Version of find is 4.4.2. The directory /common is nfs mounted. Filesystem is EXT3. My guess My guess, (obviously incorrect) was that "-print" would be performed regardless of its existance at the end of command line. (commands after -or) Closing remark Thank you for your reading my post. Have a nice day! cheers |
I see the same results.
Here's what I think is going on: Code:
find /common -name lost+found -prune -or -name fileToFindCode:
find /common ( ( -name lost+found -prune ) -or ( -name fileToFind ) ) -printCode:
find /common -name lost+found -prune -or -name fileToFind -printCode:
find /common ( ( -name lost+found -prune ) -or ( -name fileToFind -print ) )See the section in man find ending Code:
The expression on the right hand side of the -o is in parentheses only for clarity. It |
My bad!
After reading the post #2, I am depressed!! |
| All times are GMT -5. The time now is 02:23 PM. |