![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Read the csv file and assign the values in to variable | rajbal | Shell Programming and Scripting | 11 | 06-27-2009 01:17 PM |
| Assign Values to variables from a text file | sarsani | Shell Programming and Scripting | 3 | 06-26-2009 07:05 PM |
| Post Shell programming: Question about source a file and read data from the file | ccwq | Shell Programming and Scripting | 3 | 08-04-2007 10:28 PM |
| Cannot read variables after ssh with rc file (KSH) | rockysfr | Shell Programming and Scripting | 0 | 07-03-2007 04:37 AM |
| How to Read a config file and Assign to Variable | redlotus72 | UNIX for Dummies Questions & Answers | 1 | 11-13-2006 12:14 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Awk/shell question: Read from file and assign to variables.
Is anyone able to help with writing a program that will do the following:
1. Read the contents of a file, line by line, and on each line, assign each of the two columns to a shell variable. 2. perform an action on the variables 3. Read the next line. Here is what I've gotten so far. it doesn't work, and I only present it to give a better idea of what I am getting at: for i in `cat inputfile|eval \`awk '{print "HOST="$1; print "PASS="$2;}'\`` do echo "Action: host is $HOST and pass is $PASS" echo done Any assistance is greatly appreciated akbar |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|