在 Bash 中进行复制时遇到一些问题。这工作正常:
# Enable extended globbing and include filenames beginning with a '.'
shopt -s extglob dotglob
# Copy git repo to expected place
cp -r !($YOCTO_DIR) $POKY_DIR/$GIT_REPO_NAME/
Run Code Online (Sandbox Code Playgroud)
但当我if对此发表声明时:
if [ -z "$FROM_JENKINS" ]; then
# FROM_JENKINS is blank, this is a local build
# Enable extended globbing and include filenames beginning with a '.'
shopt -s extglob dotglob
# Copy git repo to expected place
cp -r !($YOCTO_DIR) $POKY_DIR/$GIT_REPO_NAME/
fi
Run Code Online (Sandbox Code Playgroud)
我得到:
./build.sh: line 80: syntax error …Run Code Online (Sandbox Code Playgroud)