![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| searching a file | straight_edge | Shell Programming and Scripting | 4 | 01-12-2007 05:21 AM |
| searching a file from folder | debasis.mishra | Shell Programming and Scripting | 3 | 04-03-2006 03:25 AM |
| help searching log file with dates | csaunders | Shell Programming and Scripting | 3 | 08-23-2005 08:50 AM |
| Append a field to the end of each line of a file based on searching another file. | ultimate | Shell Programming and Scripting | 2 | 03-29-2005 07:21 AM |
| Help with searching a text file | thekid2 | Shell Programming and Scripting | 6 | 01-01-2004 10:09 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
file searching...
Hi! i'm trying to do a script (i'm not an expert, as you will see...
mysearch -a arg1 -b arg2 -c arg3 ecc... I'd like to be able to search for files in different ways: for example, with my search -n text* -u Eddie i'd like to have all the files that begin with "text" owned by Eddie. The options should be: -n arg1 : search by name -f arg2 : search by file dimension -s arg3 : search by string -d arg4 : search by date -u arg5 : search by owner etc. I wrote these few lines (i'm not sure it's ok #!/bin/bash if [ $# = 0 ] ; then echo "Message A" ; fi ; while getopts n:f:s:d:u: c do case $c in n ) search_by_name ;; f ) search_by_dim ;; ........ * ) echo "Message B" esac done search_by_name, search_by_dim etc. must be replaced with instructions that find files with a certain name etc. My problem is how to combine the different options? That way i can search files by name or by string but i don't know how to search by name AND by string... I know it's a stupid question but as i said i'm not an expert Any help would be really appreciated! Thanks! |
| Forum Sponsor | ||
|
|
| Thread Tools | |
| Display Modes | |
|
|