The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Create a script using DATE command? thecoffeeguy Shell Programming and Scripting 1 05-15-2008 03:33 PM
trying to create a script to read a flie and loop a command... Italy87 UNIX Desktop for Dummies Questions & Answers 5 03-26-2008 04:36 AM
script to count a word in a flie sipmohan UNIX for Dummies Questions & Answers 3 02-21-2008 11:39 PM
ls while read loop - internal read picking up wrong input dkieran Shell Programming and Scripting 2 05-14-2007 12:02 PM
AWK create loop for fields tonet Shell Programming and Scripting 1 07-07-2005 06:50 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-25-2008
Registered User
 

Join Date: Mar 2008
Location: EHT, NJ
Posts: 7
trying to create a script to read a flie and loop a command...

Tried to explain this earlier, but did a poor job of it. So I am trying again but taking a different approach.....

I have a file called test_words. In this file I have one line with 5 three letter words, with a single space seperating the words.(I.e., "dog car mop red pin")

I want to create a script that will read the file and loop each word individually into a command until all words in the file have been used. Use the echo command for arguements sake.

the output would look like this as the script read the file and ran a loop with a command for each word in the file:

dog
car
mop
red
pin

The file test_word may change, by adding words or subtracting words, but always use a space as the delimiter.

can anyone help with this?

Thank you in advance for any and all help on this.
Forum Sponsor
  #2 (permalink)  
Old 03-25-2008
Moderator
 

Join Date: Feb 2007
Posts: 1,965
Italy87,

It's against the rule to double post questions:

Simple rules of the UNIX.COM forums:

Continue here:

trying to create a script to read a flie and loop a command...


Regards
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:22 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0