I use Debian (Raspbian) Wheezy. If this command line works fine:

smsd -c sms/out -i 60 -0 -f sms/smsd.log

and this alias also works fine:

bsmsd='smsd -c sms/out -i 60 -0 -f sms/smsd.log'

then why does this self-same command line in an executable bash script start the command smsd, but does not see any of the parameters I'm specifying? This is the script:


smsd -c sms/out -f /home/pi/sms/smsd.log -i 60 -0 -v

I've tried redirecting and piping, to no avail.

I'm invoking the script (it's called ssmsd) from the command line like so:


After that, this is the output from ps -fC smsd:


Edit: I know it doesn't recognise the parameters, because it tells me I didn't specify a spooling directory. But I did: -c sms/out. When called from the script, it gives version number and author, and exits.

Perhaps I should add: it calls itself a daemon, but it's not a well-behaved daemon. You can't smsd start|stop|restart it, and it doesn't run in the background. So if I call it from a command line (or with that alias) and then start another terminal and do ps -fC smsd, I get:

pi        2860  2621  0 17:49 pts/0    00:00:00 smsd -c xxxxxxx -i 60 -0 -f sms/smsd.log
  • 3
    How are you invoking the script? What makes you think it doesn't see the parameters? What does ps -fC smsd give? – Stéphane Chazelas Aug 18 '14 at 15:33
  • 1
    The parameters in the version that works (-f sms/smsd.log') are not the same than in the version that fails (-v). Maybe is that what's causing the failure? – LatinSuD Aug 18 '14 at 16:11

This looks rather obvious, you're not using the same arguments.

If this is gnokii-smsd and you specify -v, just like you're specifying in the script version it should print version and exit, just like you told it does.

Why haven't you tried with the exact same arguments when in shell mode than in script mode?

  • (slaps forehead) Because the -v was in my blind spot. Thank You! You're right, removing it fixed it. The documentation doesn't say '-v option makes smsd ignore any other parameters'. – RolfBly Aug 18 '14 at 17:57
  • And it is indeed gnokii-smsd. – RolfBly Aug 18 '14 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.