note 55627 added to function.system
| From: | vdweij at hotmail dot com | Date: | Tue, 09 Aug 2005 09:41:01 +0000 |
| Subject: | note 55627 added to function.system | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-93291@lists.php.net to get a copy of this message | ||
It is possible to only capture the error stream (STERR). Here it goes...
(some_command par1 par2 > /dev/null) 3>&1 1>&2 2>&3
-First STDOUT is redirected to /dev/null.
-By using parenthesis it is possible to gain control over STERR and STOUT again.
-Then switch STERR with STOUT.
The switch is using the standard variable switch method -- 3 variables (buckets) are required to
swap 2 variables with each other. (you have 2 variables and you need to switch the contents - you
must bring in a 3rd temporary variable to hold the contents of one value so you can properly swap
them).
This link gave me this information:
http://www.cpqlinux.com/redirect.html
----
Manual Page -- http://www.php.net/manual/en/function.system.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55627
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55627&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55627&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55627&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55627&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55627&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55627&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55627&report=yes
Search -- http://master.php.net/manage/user-notes.php