You are here: Re: How to pass variable to operating system. « All PHP « IT news, forums, messages
Re: How to pass variable to operating system.

Posted by J.O. Aho on 10/09/07 18:49

Henk Oegema wrote:

> Question: How to I pass those 3 variables from the script, to 3 variables in
> Linux (Debian).
>
> Something like:
> asterisk:~# day=${CURL(http://localhost/uptime/uptime.php)} (?????)
> asterisk:~# hour=...........
> asterisk:~# minute=.........

You would need to use

export day=`php /path/to/yout/file/uptime.php`

if you use it this way, you need to make the script to take arguments, so that
you can get the day, hour and minute alone. Don't forget to echo about the value.

Otherwise you can use a shell script with awk that can read out the values and
then set each variable, but then you could skip using php, as you get the
uptime from uptime command directly.


--

//Aho

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация