version.sh: more elegant extraction of old version