|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to prune multiple branches with find?
I wanted to prune multiple branches and only the first one is being pruned. What am I doing wrong?
I tried using "-a" instead of "-o" with no luck! Also, is there an easier way to accommodate file names with spaces other than that sed command? Thanks, Siegfried /usr/bin/find . \( -path ./Application/PRD -prune -o -path ./setup/products/PRDWeb -prune -o -path ./products/PRDWeb -prune \) -o -print | sed -e 's/^.*$/"\0"/' | xargs grep -in "PRD\\(WEB\\(UID\\|PWD\\|SERVER\\)\\|UID\\|PWD\\|USERNAME\\|PASSWORD\\|SERVER\\)" |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Your pruning example works for me.
If your find understands -print0 then the sed is necessary. You should of course also tell xargs to use zero-terminated strings with -0 (maybe that's your problem?) |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find with Prune not working | wonderbison | UNIX for Dummies Questions & Answers | 4 | 07-13-2011 05:20 AM |
| Find prune Trash | glev2005 | UNIX for Dummies Questions & Answers | 0 | 02-11-2011 10:17 AM |
| Find + prune + mtime | Nicol | Shell Programming and Scripting | 4 | 03-10-2010 02:55 AM |
| How to use -path and -prune with find | siegfried | Shell Programming and Scripting | 6 | 10-27-2009 04:46 PM |
| find with prune option | apsprabhu | Shell Programming and Scripting | 1 | 10-01-2009 01:01 AM |
|
|