accually php allready has this command and you are so close to it :)

<?php
    $user = $PHP_AUTH_USER;
    $command = 'command.sh';
    exec("$command $user", $result);
?>

--

  Chris Lee
  [EMAIL PROTECTED]


""Ken Jansons"" <[EMAIL PROTECTED]> wrote in message
001d01c0e08c$54601480$[EMAIL PROTECTED]">news:001d01c0e08c$54601480$[EMAIL PROTECTED]...
Hello,

Is it possible to have the contents of a shell_exec command go into an
array?

I have the following in my PHP script:

<?
$user="$PHP_AUTH_USER";
$command="command.sh";
$output=shell_exec("$command $user");
?>

Which calls a shell script "dirlist.sh", which returns results similar to
the following:
www
www/docs
www/test

Is it possible to have each line put into an array? so that it would look
like:
$results = array("www", "www/docs", "www/test");

The shell script has dynamic output, so the number of lines, and line
content wouldn't be the same on every execution.

I would like to use a foreach loop to put the output from the script into a
form, so I am just wondering if the command/array scenerio is possible.

Thank you for any help,

Ken Jansons
E-Mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to