![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 | Thread Starter | Forum | Replies | Last Post |
| find command with prune help | venu_nbk | UNIX for Dummies Questions & Answers | 2 | 05-28-2007 03:25 AM |
| find with prune option | highlt | UNIX for Advanced & Expert Users | 11 | 01-04-2007 08:29 AM |
| Find command with prune and exec | Sebarry | UNIX for Advanced & Expert Users | 1 | 06-18-2006 10:43 AM |
| Use -prune with find command on AIX | FuzzySlippers | UNIX for Dummies Questions & Answers | 5 | 11-08-2002 06:24 AM |
|
|
Submit Tools | LinkBack | 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\\)" |
| Forum Sponsor | ||
|
|
|
#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?) |
|||
| Google The UNIX and Linux Forums |