From 4c9ee5de13de19e30f2c7dcee0390fb0f31ce73f Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Mon, 13 Jun 2022 14:53:01 -0600 Subject: [PATCH] sed --- heavy_script.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/heavy_script.sh b/heavy_script.sh index be75bac5..d7abe91e 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -4,7 +4,8 @@ [[ -z "$*" || "-" == "$*" || "--" == "$*" ]] && echo "This script requires an argument, use --help for help" && exit -ARGS=( "$@" ) + +ARGS="$@" ; echo "$ARGS" | sed -e 's/\s?\-\-self\-update\s?//' SCRIPT=$(readlink -f "$0") SCRIPTPATH=$(dirname "$SCRIPT") SCRIPTNAME="$0" @@ -21,7 +22,7 @@ git fetch git checkout $BRANCH git pull --force echo "Running the new version..." - exec bash "$SCRIPTNAME" "${ARGS[@]/\s?\-\-self\-update\s?}" + exec bash "$SCRIPTNAME" "${ARGS[@]}" # Now exit this old instance exit 1