Bug #62982 [Opn->Fbk]: php [options] [-B <begin_code>] -R <code> [-E <end_code>]
| From: | rasmus@php.net | Date: | Fri, 31 Aug 2012 15:47:33 +0000 |
| Subject: | Bug #62982 [Opn->Fbk]: php [options] [-B <begin_code>] -R <code> [-E <end_code>] | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-173059@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62982&edit=1
ID: 62982
Updated by: rasmus@php.net
Reported by: luis dot pessoa67 at ibest dot com dot br
Summary: php [options] [-B <begin_code>] -R <code> [-E
<end_code>]
-Status: Open
+Status: Feedback
Type: Bug
Package: Scripting Engine problem
Operating System: Windos 7 SP1
PHP Version: 5.4Git-2012-08-31 (Git)
Block user comment: N
Private report: N
New Comment:
Works fine for me on Linux:
> ls | php53 -B '$l=0;$i=1;' -R '$l+=count(@file($argv[$i++]));' -E
> 'echo "files:
$l\n";'
files: 449
Weird Windows thing?
Previous Comments:
------------------------------------------------------------------------
[2012-08-31 15:06:28] luis dot pessoa67 at ibest dot com dot br
Description:
------------
---
From manual page: http://www.php.net/features.commandline.options
---
Why Didn't it work?
c:\php>dir /aa /b | php -B '$l=0;$i=1;' -R '$l+=count(@file($argv[$i++]));'
-E 'echo "files: $l\n";'
Parse error: syntax error, unexpected end of file in Command line begin code on
line 1
Parse error: syntax error, unexpected ''echo' (T_ENCAPSED_AND_WHITESPACE) in Com
mand line end code on line 1
c:\php>php -v
PHP 5.4.5 (cli) (built: Jul 18 2012 22:25:51)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
Test script:
---------------
c:\php>dir /aa /b | php -B '$l=0;$i=1;' -R '$l+=count(@file($argv[$i++]));'
-E 'echo "files: $l\n";'
Expected result:
----------------
files: XXXXX
Actual result:
--------------
Parse error: syntax error, unexpected end of file in Command line begin code on
line 1
Parse error: syntax error, unexpected ''echo' (T_ENCAPSED_AND_WHITESPACE) in Com
mand line end code on line 1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62982&edit=1