I am trying to trim down an output in some code I'm working on, and for whatever reason can't get it to work.
version= wget --output-document=- https://dolphin-emu.org/download 2>/dev/null \ | grep 'version always-ltr' -m 1
until [[ "${version::2}" == "." ]];
do version= echo "$version" | sed 's/^.//'
done
until [[ "${version: -1}" -ge "0" ]];
do version= echo "$version" | sed 's/.$//'
done
echo $version
Initially, $version equals something long and clunky:
<td class="version always-ltr"><a href="/download/dev/8ecfa537a242de74d2e372e30d9d79b14584b2fb/">5.0-16101</a></td>
However, I only want the 5.0-xxxxx
number. How do I do that? (Or what absolutely idiotic mistake am I making?)