Computing.Net > Forums > Unix > Input cell numbers to script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Input cell numbers to script

Reply to Message Icon

Name: hismail
Date: October 12, 2009 at 23:26:46 Pacific
OS: Linux/Aix
Product: Red hat Enterprise linux for intel itanium - ( v. 5 ) - medi
Subcategory: Software Problems
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: user57
Date: October 13, 2009 at 03:14:15 Pacific
Reply:

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


0

Response Number 2
Name: hismail
Date: October 15, 2009 at 05:45:25 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Input cell numbers to script

Giving an input value to a script www.computing.net/answers/unix/giving-an-input-value-to-a-script/8387.html

Need Help With KSH Script www.computing.net/answers/unix/need-help-with-ksh-script/6747.html

bash scripting www.computing.net/answers/unix/bash-scripting/6533.html