Write an automatic git copy with php + bash_profile, but how to enter the string?

system("git commit -a -m "quick commit" ");
system("git push");

then build one in ~. Bash _ profile, wrote a shortcut

alias push="php /Users/XXX/Projects/XY/push.php"

but what I want to achieve is:

suppose I enter push "GOOD BADDDD"
so I can get this value in push.php and replace quick commit into GOOD BADDDD
. Is this possible?

Jul.30,2021

try the Google "php command line parameter"


in command-line mode, the number of parameters passed to the script is saved in the global variable $argc , and the parameter array is stored in the global variable $argv .

Command Line

php test.php name test sex unknow

test.php

<?php

print_r(":" . $argc);
print_r(":\n");
print_r($argv);

the above code has not been tested. For more information, please see PHP command line mode


$_ SERVER ['argv']
Menu