Having some trouble doing a copy in Bash. This works fine:
# 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/
But when I put an if statement round it:
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
I get:
./build.sh: line 80: syntax error near unexpected token `('
Line 80 is the cp. If I remove the brackets it works:
cp -r . $POKY_DIR/$GIT_REPO_NAME/
Why does the if statement not like brackets in cp?
--andfailgloboption.