Making big find command more human readable | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Making big find command more human readable

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-26-2013
Michael Stora Michael Stora is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 18 September 2014, 4:02 PM EDT
Posts: 148
Thanks: 44
Thanked 14 Times in 12 Posts
Making big find command more human readable

This does not work. One line works but my pattern are about 100 characters long and it is messy to read. When I try to use several lines it does not two'


Code:
find "$inputDirectory" \( -name 'very long pattern1'
                       -o -name 'very long pattern2'
                       -o -name 'very long pattern3'
                       -o -name 'very long pattern4' \) > file


Code:
 find: invalid expression; I was expecting to find a ')' somewhere but did not see one.

Mike

---------- Post updated at 04:29 PM ---------- Previous update was at 04:19 PM ----------

Nevermind! I have forgotten so much . . .


Code:
find "$inputDirectory" \( -name 'very long pattern1' \
                       -o -name 'very long pattern2' \
                       -o -name 'very long pattern3' \
                       -o -name 'very long pattern4' \) > file

Mike
The Following User Says Thank You to Michael Stora For This Useful Post:
jim mcnamara (03-27-2013)
Sponsored Links
    #2  
Old 03-27-2013
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 23 October 2014, 9:54 PM EDT
Location: NM
Posts: 10,250
Thanks: 282
Thanked 803 Times in 747 Posts
Thanks for posting the solution.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Make netstat human readable? MrEddy UNIX for Dummies Questions & Answers 10 03-04-2011 03:28 PM
Human readable sizes in Solaris bdf maxim42 Shell Programming and Scripting 8 03-04-2010 07:03 AM
script to convert epoch into human-readable snoman1 Shell Programming and Scripting 3 04-18-2008 03:59 PM
human readable format of file size when doing ls l umen UNIX for Dummies Questions & Answers 1 09-28-2005 09:20 AM
formatting output in human readable numbers ghazi Shell Programming and Scripting 11 01-10-2005 12:31 PM



All times are GMT -4. The time now is 09:31 AM.