Skip to content

Instantly share code, notes, and snippets.

@ayharano
Created June 13, 2023 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayharano/b1dad7037b7387d12deefca5202b0436 to your computer and use it in GitHub Desktop.
Save ayharano/b1dad7037b7387d12deefca5202b0436 to your computer and use it in GitHub Desktop.
pyenv versions
# install latest
for i in {7..11}; do V=$(pyenv install --list | grep "^[[:space:]]*3\.${i}\.[0-9]*" | tail -n 1 | sed 's,[[:space:]]*,,g'); echo "${V}"; yes n | pyenv install ${V}; echo; echo; done
# forced uninstall everything but latest
for i in {7..11}; do for V in $(pyenv versions | grep "^[[:space:]]*3\.${i}\.[0-9]*" | ghead -n -1 | sed 's,[[:space:]]*,,g'); do echo "${V}"; yes n | pyenv uninstall --force ${V}; done; echo; echo; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment