Timeline for echo gammu environment variable
Current License: CC BY-SA 3.0
17 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 16, 2018 at 17:29 | comment | added | lucian | that is not a problem, since this is a test system anyway. I am using it to prototype this script and add some functionality to it. thank you for your help! | |
| Feb 16, 2018 at 15:22 | comment | added | Kusalananda♦ |
@lucian Good! That means that you now also have another smslog.dat somewhere on the system (probably, from the previous runs).
|
|
| Feb 16, 2018 at 15:21 | vote | accept | lucian | ||
| Feb 16, 2018 at 15:21 | comment | added | lucian | you were right! full path to the smslog.dat file was the answer! thank you so much for your help! | |
| Feb 16, 2018 at 15:19 | history | edited | Kusalananda♦ | CC BY-SA 3.0 |
added 171 characters in body
|
| Feb 16, 2018 at 15:18 | comment | added | Kusalananda♦ | @lucian Not my cup of tea, and too big a machine for what should be a trivial task. | |
| Feb 16, 2018 at 15:17 | comment | added | lucian | could it be easier to do this in python? (much less experience with that one but I am willing to learn!) | |
| Feb 16, 2018 at 15:17 | comment | added | Kusalananda♦ |
@lucian Sure, that tells you that it's executing /home/pi/scripts/test.sh which I presume is your script, but it doesn't say what the directory that acts as the current working directory is (it is not automatically /home/pi/scripts unless you cd there inside the script). You may obviously also give the absolute pathname to the smslog.dat file in the script as you are writing to it, e.g. done >>/home/pi/scripts/smslog.dat.
|
|
| Feb 16, 2018 at 15:13 | comment | added | lucian | I tried again with the smslog.dat in the same folder as the script and still nothing. I have echoed the other variables too and I get the correct answers so they are present and can be read but not in a loop. So if I echo $SMS_1_NUMBER and echo $SMS_1_TEXT it works. But not if instead of 1 I put ${i} from the for (or while) loop. Much too weird for me! | |
| Feb 16, 2018 at 15:09 | comment | added | Kusalananda♦ |
@lucian The script assumes that the variables are exported and available to the script. It also assumes that smslog.dat is located in the current directory from where the script is executing. It may be that the script is not executing from where you think it is. You may see the current working directory path by echo "$PWD" in the script.
|
|
| Feb 16, 2018 at 15:04 | comment | added | lucian | still no joy! nothing is written. i have created the empty file prior to lanching the script and still nothing | |
| Feb 16, 2018 at 14:59 | comment | added | Kusalananda♦ |
@lucian I have just now fixed two syntax errors (missing " in two places). Sorry about that, try again.
|
|
| Feb 16, 2018 at 14:58 | history | edited | Kusalananda♦ | CC BY-SA 3.0 |
added 2 characters in body
|
| Feb 16, 2018 at 14:56 | comment | added | lucian | when i send a message I get in the gammu log file the correct output: Subprocess output: 1. This means that gammu has launched the script and processed it | |
| Feb 16, 2018 at 14:54 | comment | added | Kusalananda♦ |
@lucian If you add echo "$SMS_MESSAGES" at the top before the loop, what does it print?
|
|
| Feb 16, 2018 at 14:51 | comment | added | lucian | thank you for your answer but for some reason nothing is written in the smslog.dat with the second option which I would prefer. | |
| Feb 16, 2018 at 14:38 | history | answered | Kusalananda♦ | CC BY-SA 3.0 |