![]() |
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 |
| Filter data from text file | b_sri | Windows & DOS: Issues & Discussions | 18 | 04-16-2008 10:41 AM |
| Extracting data from text file based on configuration set in config file | suparnbector | Shell Programming and Scripting | 3 | 08-10-2007 02:25 AM |
| Exporting text file data to csv | l_jayakumar | Shell Programming and Scripting | 3 | 09-18-2005 11:27 PM |
| How to extract data from a text file | negixx | Shell Programming and Scripting | 1 | 07-19-2005 09:30 PM |
| getting data out from a text file | skotapal | Shell Programming and Scripting | 7 | 09-14-2002 11:10 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
How to fetch data from a text file in Unix
I want to fetch passwords from a common file xxxx.txt and use it in a script.
Currently the password is hardcoded so this have to be changed so that password can be fetched from text file..... Please reply asap.. Thanks |
|
||||
|
Try the "FOR Loop..."
you can use the below FOR loop.
If you have only password in the xxxx.txt, then this will help. Otherwise you need to cut to get the value stored, into the passwd variable. ######################### for x in `cat xxxx.txt` do passwd=$x # #your processin will come here. # done ######################### Please revert if u hv any concerns. Best Regards, Karthikeyan. |
|
||||
|
Hi
Sorry for the late reply. Was little busy with work. ######################### for x in `cat xxxx.txt` do passwd=$x # #your processing will come here. # done ######################### What are you going do after getting the password in a variable ??? thats what i meant by that sentence. Pls let me know your exact requirement if this doesn't answer you....:b |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|