diff --git a/heavy_script.sh b/heavy_script.sh index f5792fc7..774b0ce7 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -22,7 +22,13 @@ git fetch git checkout $BRANCH git pull --force echo "Running the new version..." - exec bash "$SCRIPTNAME" "${ARGS[@]//[[:space:]]?--self-update[[:space:]]?}" + count=0 + for i in ${ARGS[@]} + do + [[ "$i" == "//[[:space:]]?--self-update[[:space:]]?" ]] && unset "${ARGS[$count]}" + ((count++)) + done + exec bash "$SCRIPTNAME" "${ARGS[@]}" # Now exit this old instance exit 1