How can I do to pass a variable to a php file in a shell script, I'm trying to do that below, without success.
php -f complete.php?login=$1
How can I do to pass a variable to a php file in a shell script, I'm trying to do that below, without success.
php -f complete.php?login=$1
There will be a $argv
variable that will be an array with values passed via CLI, but not the way you did it. Just pass the value as an script argument:
$ php -f complete.php teste
So, if you make the value of $argv
it will be ['teste']
.
See more in the official documentation: Array of arguments passed to the script .