From:             arne at fotos dot dyndns dot biz
Operating system: LINUX
PHP version:      4.3.4
PHP Bug Type:     Program Execution
Bug description:  passthru does not work with subshells

Description:
------------
when I have 2 files t and t2 and I try to diff them with

diff <(cat t) <(cat t2) LINUX-shell produces 2 meta-files
(/dev/fd/[00-99]) to pipe into the diff command. Thats usual, thats
basic.
If I try to use the same command in passthru("diff <(cat t) <(cat t2)"); I
run into errors:
sh: -c: line 1: syntax error near unexpected token '('
sh: -c: line 1: 'diff <(cat t) <(cat t2)'
The files are in the PATH and I can see output of t when I do:
passthru("cat t"); what means that cat is available too.


Reproduce code:
---------------
file X.php4:
-----snip--------
<?php passthru("diff <(cat t) <(cat t2)"); ?>
-------snap------

shell:> php X.php4

Expected result:
----------------
1,3c1,4
< MIKE
< bravo
< charly
---
> VANDA
> PHP
> Utah
> russia

Actual result:
--------------
sh: -c: line 1: syntax error near unexpected token '('
sh: -c: line 1: 'diff <(cat t) <(cat t2)'

-- 
Edit bug report at http://bugs.php.net/?id=26532&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26532&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26532&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26532&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26532&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26532&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=26532&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=26532&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26532&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26532&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26532&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26532&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26532&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26532&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26532&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26532&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26532&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26532&r=float

Reply via email to