我有一个名为'wpautobuild.sh'的文件。在该文件中,我有一段脚本,可以在linux服务器上自动设置开发环境和网站。
我一直在用以下命令调用脚本中名为wp_auto_build()
的函数:
$ ./wpautobuild.sh; wp_auto_build --project=abctest1
这一直很好,直到我关闭了我的终端会话并重新启动它。现在,当我运行相同的命令时,我得到以下错误:
-jailshell: wp_auto_build: command not found
我不知道为什么我可以把它运行一段时间,但现在我不能了。文件中没有任何更改。我承认,我在编写shell脚本方面经验不足。
这是wpautobuild.sh:
#!/bin/sh
###########
# Variables
###########
#Required Variables
#BashRC File
FILE_BASH="$HOME/.bashrc";
FILE_WPAB="$HOME/wpautobuild.sh";
#The parent folder for all your site files
PATH_DEV="/home/wm/public_html";
#MYSQL Variables
MYSQL_UN="someuser";
MYSQL_PW="somepass";
#Repositories
declare -A REPO_PATH;
REPO_PATH[jumpstart]="https://someuser@bitbucket.org/someuser/wp-jumpstart.git";
REPO_PATH[divi]="https://someuser@bitbucket.org/someuser/divilib.git";
declare -A WP_DB_PREFIX;
WP_DB_PREFIX[jumpstart]="wp_";
WP_DB_PREFIX[divi]="wp_";
#Color variables
GREEN="