![]() |
|
|
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 |
| Want read and an built in enter key stroke | RahulJoshi | Shell Programming and Scripting | 2 | 01-02-2009 09:38 PM |
| Compare array values | shantanuo | UNIX for Dummies Questions & Answers | 2 | 10-21-2008 06:41 AM |
| incorrect array values | jhillier | UNIX for Dummies Questions & Answers | 6 | 01-04-2008 04:44 AM |
| to assign cut values to an array | Syms | UNIX for Dummies Questions & Answers | 6 | 10-29-2007 06:42 AM |
| read the ENTER key | sars | Shell Programming and Scripting | 4 | 11-27-2006 08:34 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Read textfile and enter the values in array
Hi,
I want to put values in .txt file into array. Example : $vi repo.txt abc def ghi jkl mno pqr i want the output to be like this: $echo ${mydf[1]} abc $echo ${mydf[2]} def $echo ${mydf[3]} ghi $echo ${mydf[4]} jkl $echo ${mydf[5]} mno $echo ${mydf[6]} pqr my script: for i in 1 2 3 4 5 6 do read mydf[$i] < repo.txt print "mydf[$i] value is ${mydf[i]}" done What's wrong with my script? cuz anytime I echo ${mydf[1]}, I got empty output.. not abc... Please helppp ![]() Thanks ![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|