OK, I should provide more info. first I am running in ksh.
I have a file with one line of a series of words that are three letters long, using s space as the delimiter.
I want to run a script which will retrieve those words and assign them to a variable, which i can run with my command in a loop until each word has been used, individually each time in the command until each three letter word has been used.
the file looks like this:
AIN OTB ALK SJA ALS HAH INA (etc..)
I want to run the command with all three letter word individually.
The commands i want to perform is already designed. I just need to insert the words in the command in a loop to do it each tmie. note the file may change with the count of words but it will always be three letter words. therefore it has to count the words each time it is run. i was thinking I would cat the file, pipe it to a wc -w and use that as the count for how many time to perform the loop. (I.e. wordct="cat <filename> | wc -w") with this variable I have a defined count of how many words each time.
I hope this helps.
|