Input cell numbers to script

Red hat Enterprise linux for intel itani...
October 12, 2009 at 23:26:46
Specs: Linux/Aix
Hi
I have a script where i need to input a list of cell phone numbers to be mailed to eg:
0845472182
0837891718
0938948948
0238840848
called smslist.txt
My needs to read the numbers from the list to do this
mailx -s "$smslist.txt" -r emailaddress@co.za smsaddress@.co.za <test file

thanks
Hamim


See More: Input cell numbers to script

Report •

#1
October 13, 2009 at 03:14:15
I'm not sure I understand your request.

To send the entire list:
cat smlist | mailx -s "Enter subject text" emailaddress@domian.com

To loop through the list and send each number individually:
for num in `cat smlist`

do

echo $num | mailx -s "Enter subject text" emailaddress@domian.com

done


Report •

#2
October 15, 2009 at 05:45:25
I got it to work with one number eg:
mailx -s 0845472183 -r emailaddress@co.za smsaddress@.co.za <test file

I now need to read the smslist.txt file


Report •

#3
August 17, 2010 at 08:52:05
facciabella3000@hotmail.com

2154360365


Report •
Related Solutions


Ask Question