Stephen Weeks wrote:
Chris Carey wrote:

if (!file_exists($argv[1])) exit;
[EMAIL PROTECTED]($argv[1]);


Ryan Byrd wrote:

$fp = fopen ($argv[1],"r");


Josh Coates wrote:

your code should assume that the input is coming via standard input (stdin)

Here's a function I use on my shell scripts, if that helps.

function ask($string, $default = false) {
                       if(is_string($string)) {
                               fwrite(STDOUT, "$string ");
                               $input = fread(STDIN, 255);
if($input == "\n") {
                                       return $default;
                               }
                               else {
                                       $input = trim($input);
                                       return $input;
                               }
                       }
               }

Steve


/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to