python-search.sh 225 B

123456789101112
  1. #!/bin/sh
  2. for name in python python2 python2.6 python2.7 python2.8 python2.9
  3. do
  4. $name -c 'import sys; sys.exit(not((2, 6) <= sys.version_info < (3, )))' \
  5. 2> /dev/null
  6. if test $? -eq 0
  7. then
  8. echo $name
  9. break
  10. fi
  11. done