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/10/07 04:43

Jerry Stuckle wrote:
> Henk Oegema wrote:
>>> J.O. Aho wrote:
>> Tnx Aho for answering. :)
>>> Henk Oegema wrote:
>>>
>>>
>>> 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.
>> Can you please be a little bit more specific. It's not quit clear to me.
>> Why (and how) must the script take arguments? The values of the 3
>> variables are already known to the script.
>> I only need to pass them to the operating system.
>>> 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.
>> You right, this is also a possibility.
> But what's the operating system going to do with them?
> The operating system doesn't take parameters. Rather, you run a program
> (even if it is the shell) which does something with parameters.

The values are already "stored" in the OS in question, it do have track of
it's own lifespan, but of course not stored as a variable that is accessible
by the shell.

if the OP exports the value, they will only be in the shell he currently works
in, switching to another virtual console will just make that the variables in
question are empty as they never been set.
Of course it would be possible to set the values in ~/.bashrc, but then the
values will be different for each shell.

Not sure if the OP really thought about what he wants to do...

--

//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

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