I am new to shell scripting. I have the following snippets and it is really complex. The more I look at it the more I get confused.
while test $# -gt 0; do
[[ $1 =~ ^-c|--chartrelease$ ]] && { chartRelease="$2"; shift 2; continue; };
echo "Parameter not recognized: $1, ignored"
shift
done
: "${chartRelease:="default"}"
Can any provide a simple explanation to clear this mistery? For example what is the purpose of $1 =~ ^-c|--chartrelease$