[smokeping-users] Re: Help Required (SMS Script)

Marc Powell marc at ena.com
Fri Dec 22 01:22:26 MET 2006



> -----Original Message-----
> From: smokeping-users-bounce at list.ee.ethz.ch [mailto:smokeping-users-
> bounce at list.ee.ethz.ch] On Behalf Of Syed Waqqas Ahmed
> Sent: Thursday, December 21, 2006 5:25 PM
> To: mrtg at list.ee.ethz.ch; smokeping-users at list.ee.ethz.ch
> Subject: [smokeping-users] Help Required (SMS Script)
> 
> Dear All,
> 
>   Thanx for reply and concerns...just stuck in 1 last step.
> 
>   Can some 1 help me out with php and bash programming.. as i am able
to
> check the mail and compress it for sms using PHP script and wrote a
> program on bash to send the sms.... i m just wondering how to pass a
value
> stored in PHP variable or in <STDIN> to a bash script.
> 
>   i have to excute this final command
>   echo <value of STDIN> | /usr/local/bin/gnokii --sendsms <mobile
Number>
> 
>   Can some one help me out in this.. ??

If the value is passed to your script as a command line argument then
it's stored as $1 in bash. Excuse my pseudo-php below

<?
$last_line = system('/path/to/yourscript $variable', $retval);
?>

/path/to/yourscript --

#!/bin/bash
echo $1 | /usr/local/bin/gnokii --sendsms <mobile Number>

If what you're passing includes spaces or special characters, enclose
"$variable" in quotes.

http://www-128.ibm.com/developerworks/library/l-bash2.html

--
Unsubscribe mailto:smokeping-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:smokeping-users-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/smokeping-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the smokeping-users mailing list