PHP Shell-like return codes
| From: | Patrick Zwahlen | Date: | Mon, 09 Oct 2000 16:46:26 +0000 |
| Subject: | PHP Shell-like return codes | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-19211@lists.php.net to get a copy of this message | ||
Hi you all,
I'm using PHP in its CGI mode in order to create scripts like
Shell or PERL scripts, ie scripts like:
------------------------
#!/usr/local/bin/php -q
<?
print("Hello World");
?>
------------------------
The problem I have is that it seems there's no way to return a code
(like in a shell script using exit(-1)), which could then be tested by a
REGULAR Shell script with an IF statement. I would like to be able to
write a script like:
------------------------
#!/bin/sh
if myscript.phx ; then
echo TRUE
else
echo FLASE
fi
------------------------
In 'myscript.phx', I've tried to use both RETURN() and EXIT() PHP
commands, without any success :-(((
Any clue how this problem could be solved ?
Many thanks in advance... - P. Zwahlen -
--
Patrick Zwahlen patrick.zwahlen@hq.worldonline.ch
IT Manager Phone: +41 (0)21-641-5950
World Online Switzerland Mobile: +41 (0)78-671-1554
Av. Gratta-Paille 2 Fax: +41 (0)21-683-1344
CH-1000 Lausanne 30 Web: http://www.worldonline.ch