php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #14747 Return exitcodes to shell ($?)
Submitted: 2001-12-28 16:39 UTC Modified: 2001-12-31 10:25 UTC
From: bernd dot herbold at gmx dot de Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.6 OS: Windows 2000 with mks-tools
Private report: No CVE-ID: None
 [2001-12-28 16:39 UTC] bernd dot herbold at gmx dot de
Hi,

I tried to use PHP in connection with shellprogramming.

I would be fine if you could return exit codes to shellscripts. So that you can use something like "if [ $? -eq 0 ]" to test if the PHP-Script had run succesful.

So wouldn`t need to use Perl in future.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-29 15:27 UTC] derick@php.net
just use exit(number)
it returns the exit code (and also prints the value). The printing will be removed in PHP5 (if it is a number).

Derick
 [2001-12-29 16:22 UTC] bernd dot herbold at gmx dot de
Sorry,
I just tried your suggestion under Linux and it works.

But under Windows2000 with the mks-Toolkit and there it dosn't work.
Thnx
Bernd
 [2001-12-31 10:25 UTC] bernd dot herbold at gmx dot de
My mistake.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 18:01:33 2024 UTC