Re: Curious PHP cli output in context of bash completion ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Le 28 janv. 2010 à 00:42, Ashley Sheridan a écrit :

On Wed, 2010-01-27 at 23:27 +0100, Rene Veerman wrote:
> My initial goal is to complete a PHP script, using the PHP script itselfs as function for bash completion. Mechanism that works perfectly on some other platforms (with different PHP AND bash version ...) than Ubuntu 8.04 and 9.10 (PHP 5.2.4 and PHP 5.2.10 respectively). The interest : only one thing to code : the php script. Moreover : the PHP scripts knows "things" (DB connection, .. etc) that the bash script would have some difficulty to get.
>
> Thank you a lot for any help.
>
> --
> Alex
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Also, MySQL has good command line tools and there are plenty of command line interfaces to it you can use from Bash

Thanks,
Ash
http://www.ashleysheridan.co.uk

Yes, I know how to use MySQL binaries ;).
But it's not only about MySQL business : in my context, the PHP script has access to many business processes that only exists in PHP code. In this context (to my mind), it is quiet normal and simpler to get bash completion variables value from the PHP itself.

We could probably continue to discuss this design issue but the problem is that, in the context of bash completion process, echoscript.php and echoscript.sh that simply echo "a b c d" (exactly the same output), give different results and I can not understand why ... I searched for runtime options (php.ini) but didn't found anything relevant. I also searched about the "shebang" but with no result.

I just attached a modified version of completion.sh, the script to source in the current bash process to complete "myscript.php" (see http://ubuntuforums.org/showthread.php?p=8734334 for a complete description).
If you uncomment the lines that call echoscript.php and echoscript.sh, you can compare php.out and sh.out files and see they are identical (using "diff -b php.out sh.out" for instance). When echoscript.php is not called, the bash completion process works. When it is called the completion goes wrong, even if you do not use the output in the completion process (the modified version of completion.sh uses a "static" bash string "a b c d").

Can anyone understand what could happened ?

Thank you,

Attachment: completion.sh
Description: Binary data


-- 
Alex




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux