Hello! My task is to remove all extra symbols from named argument. For instance I have ,,,--no-color,, option passed to script and I have to cut everything but --no-color. I've solved it via Bash code:
(you can also open it via Repl.it)
And now I wanna translate it to Batch Script. How can I do it? I don't know how to rewrite this globbing expression to batch file
Bash:
shopt -s extglob
option="--no-color,,"
pattern="--+([[:alpha:]]*(-[[:alpha:]]))"
while [[ "$option" == @(+(,)$pattern|$pattern+(,)|+(,)$pattern+(,)) ]]
do
option=${option##*(,)}
option=${option%%*(,)}
done
echo "$option"
And now I wanna translate it to Batch Script. How can I do it? I don't know how to rewrite this globbing expression to batch file
@(+(,)$pattern|$pattern+(,)|+(,)$pattern+(,))
.