I am trying to write a script that uses some environtment variables that are set by the sms sending/receiving program gammu. These variables are set at the moment when messages are received/sent and are not accessible otherwise. This means that the script must run by the daemon to make use of these variables. This isn't a problem, but actually accessing these! This is the example script I am trying to run from withing gammu.
#!/bin/sh
for i in `seq $SMS_MESSAGES` ; do
echo SMS_"${i}"_NUMBER SMS_"${i}"_TEXT >> smslog.dat
done
Basically I want to make a log of all the messages received. However with the above script all I get is SMS_1_NUMBER SMS_1_TEXT. How can I get the values stored in these variables?