Reply to Re: Reading Shell Script Results

Your name:

Reply:


Posted by Erwin Moller on 10/11/68 11:20

melih.onvural@gmail.com wrote:

> Group,
>
> I want to get into a remote server, tail a file, and see if the last
> line is an error or not. I think that I've figured out how to shell
> over and tail the file. I have the specific server information and
> filename/location all stored in a database. I can't figure out how to
> get the result of the tail into a variable so that I can search it for
> an ERROR string. Any ideas?
>
> thanks in advance,
>
> melih

Hi,

If you can write the command (including the tail) and execute succesfully in
a shell, you can also give it to PHP and let PHP execute it.
Then you catch the result.

http://nl2.php.net/manual/en/ref.exec.php

It contains many usefull links to functions you might want to use.

I think shell_exec is usefull for you, but just scan through them and decide
for yourself.

shell_exec:
Execute command via shell and return the complete output as a string

Hope that helps.

Regards,
Erwin Moller

[Back to original 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

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