I am trying to run a PHP function inside Bash ... but it does not work.
#! /bin/bash /usr/bin/php << 'EOF' <?php echo getcwd(); ?> EOF
In reality, I needed to store the return value in a bash variable ... By the way, I use the phc getcwd () function only to illustrate the bash operation.
UPDATE: Is there a way to pass a variable?
VAR='/$#' php_cwd=`/usr/bin/php << 'EOF' <?php echo preg_quote($VAR); ?> EOF` echo "$php_cwd"
Any ideas?
Roger
source share