I need help in passing the Linux bash-script variable to execute the PHP CLI command.
I am working on the bash-script that executes PHP CLI command that gets input variable from the bash-script like folder-path to include a file for accessing a class of the PHP file.
But what happens while executing the bash-script is that the variable passed to the PHP CLI-command act as a variable for PHP.
Below is the sample-code my script
file="$folderpath"somefile.php
mage_version=$(php -r 'include "$file";print_r(Mage::getVersionInfo());')
Below is the error I am getting
PHP Notice: Undefined variable: file in Command line code on line 1
PHP Warning: include(): Filename cannot be empty in Command line code on line 1