このコードの応用でできますかね?
いまいちこのコードがなにやってるのかよくわからんのですが

https://unix.stackexchange.com/questions/258512/how-to-remove-a-positional-parameter-from

for arg do
shift
[ "$arg" = "-inf" ] && continue
set -- "$@" "$arg"
done

printf '%s\n' "$@"