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

while read ANYNAME
do

echo ${ANYNAME}
#each line will be stored in this variable 1 at a time
*****
done < xxxx.txt

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.

can you please tell me what exactly do u mean by

#
#your processin will come here.
#
done
#########################

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