Use pipe and sed in configure.ac

2011-02-10 Thread Lyre
I tried to exact an option from php-config using: php-config --configure-options | sed -n 's|.*--with-config-file-scan-dir=\([^ ]*\).*|\1|p' It works on shell, and outputs /etc/php5/conf.d/ on opensuse. And I tired it in configure.ac, as following: PHPINC=`php-config --includes`

Re: Use pipe and sed in configure.ac

2011-02-10 Thread Ralf Wildenhues
Hello Lyre, * Lyre wrote on Thu, Feb 10, 2011 at 04:39:41AM CET: php-config --configure-options | sed -n 's|.*--with-config-file-scan-dir=\([^ ]*\).*|\1|p' It works on shell, and outputs /etc/php5/conf.d/ on opensuse. And I tired it in configure.ac, as following: PHPCDIR=`php-config

Re: Use pipe and sed in configure.ac

2011-02-10 Thread Eric Blake
On 02/10/2011 12:05 PM, Ralf Wildenhues wrote: Hello Lyre, * Lyre wrote on Thu, Feb 10, 2011 at 04:39:41AM CET: php-config --configure-options | sed -n 's|.*--with-config-file-scan-dir=\([^ ]*\).*|\1|p' It works on shell, and outputs /etc/php5/conf.d/ on opensuse. And I tired it in

Re: Use pipe and sed in configure.ac

2011-02-10 Thread Gary V. Vaughan
On 10 Feb 2011, at 10:39, Lyre 417...@gmail.com wrote: I tried to exact an option from php-config using: php-config --configure-options | sed -n 's|.*--with-config-file-scan-dir=\([^ ]*\).*|\1|p' It works on shell, and outputs /etc/php5/conf.d/ on opensuse. And I tired it in

Re: Use pipe and sed in configure.ac

2011-02-10 Thread Eric Blake
On 02/09/2011 08:39 PM, Lyre wrote: I tried to exact an option from php-config using: php-config --configure-options | sed -n 's|.*--with-config-file-scan-dir=\([^ ]*\).*|\1|p' It works on shell, and outputs /etc/php5/conf.d/ on opensuse. And I tired it in configure.ac, as following:

Re: Use pipe and sed in configure.ac

2011-02-10 Thread Lyre
Thanks to peter and Eric. Yes, the problem is the square backect. It should be \([[^ ]]*\). After I put it in set -vx/set +vx block, I notice the command exactly executed was: php-config --configure-options | sed -n 's|.*--with-config-file-scan-dir=\(^ *\).*|\1|p' both backet were missing.

Re: Use pipe and sed in configure.ac

2011-02-10 Thread Peter O'Gorman
On 02/09/2011 09:39 PM, Lyre wrote: PHPINC=`php-config --includes` PHPCDIR=`php-config --configure-options | sed -n 's|.*--with-config-file-scan-dir=\([^ ]*\).*|\1|p'` Probably the [] in your sed expression need extra quoting. e.g. \([[^ ]]*\) You can verify by looking at the generated