Question:
awk/perl/bash script?
anonymous
2007-05-05 18:14:12 UTC
Hi guys

I am very new to scripting and programming, but i need a simple script that will execute a report (awk based) by reading in a file

I basically need to do the following using an already made script that is called shownamescript

shownamescript "name" |grep "text_to_match"

I need the "name" to be read from a file.I have 500 names to match in order to grep out some information from the name, and i don't want to sit and run the script 500 times

can anyone help with a script that will run this shownamescript on each name in the file and output the "text_to_match" information?

Thankyou so much
Three answers:
a_non_a_miss_2000
2007-05-08 18:31:11 UTC
Assuming the file containing your list of names has each name on its own line. You should be able to do it using another script that loops through each line. Perhaps something like:



for name in `cat names.txt`

do

shownamescript "$name" | grep "text_to_match"

done



I don't have BASH available to me at the time to test this, but your script will be something very similar to the above.



The Data Analyst - http://www.squidoo.com/thedataanalyst
hillhouse
2016-12-11 01:23:12 UTC
from what you wrote the guy is probably sleazy..think of approximately it a hotel room who shoots video clips at a hotel and then he stated you dont want a script that doesnt make experience. i dont be attentive to if thats the kind of action picture you opt to be in yet once you opt to break into the industry as a professional actor i wouldnt do it. identification discover someplace else to artwork possibly as an further on a series or discover an agent..many human beings will take great factor approximately people who dont be attentive to something on the subject of the corporate dont enable them to push you over..do your learn and wait and see simply by fact basically like one reliable action picture could make you, one undesirable action picture can ruin you. i wish this facilitates!! -Bella
Mayukh Datta Roy
2007-05-05 19:00:42 UTC
The follwing script does the job.

It assumes that the names are in names.txt

Replace it with the filename where all the names reside.

----
Loading...