Well looking at the input you do not currently require any looping as awk will process each line in turn:
Code:
awk -F":" '{if($3 == "WWW")colonel = "the Web";else colonel = "Usenet";print "All files starting with "$1" come from \033[1m"$2"\033[0m on "colonel"."}' handmade2.txt |
Staying with what's familiar, got a script that works.
I found that unusual (to me, at any rate) grep syntax that helped, temporarily, with another script project and applied it to this one. Seems to work where case/esac didn't (description of that forthcoming).
Code:
while read 'line'; Code:
while read 'line'; This was after I tried out a case/esac that was suggested to the OP in the same thread. For me, and in my script, arranging the variables one way gave me "There's a match" on every return; arranging them another way gave me nothing at all. So I went with the "special" grep -q and the triple left-handed carats and was quite gratified when I got an output like this, running the first script (above) on the aforementioned "folder of 20": Code:
There's a match. amanor-154-003.jpg with 'AmateurManor.com'. There is also -- and this is something I noticed a few days ago perusing the list of 20K+ files that iView generated for me earlier on -- the potential with this script to make corrections with already-annotated files where the Credits don't match their file name "heads". I found more than 100 on the mega-list that meet this description. But that's for another day and another pot of coffee. :) I think with this script, and its successors (the "housekeeping" ones it's sure to inspire, if not generate) that this issue is really, truly, Solved this time. I'll be sure to mark it so before I log off. Thanks for all the help to grail, ghostdog, and the others who gave their time, energy and experience to help me out with this. BZT |
Well you can probably speed it up a bit by removing some of the superfluous steps and commands:
Code:
while read line Code:
while read line |
All times are GMT -5. The time now is 03:27 PM. |