
gcc -v 2>&1 |\
 sed -n '/version/s#^[^ ]* [^ ]* \([0-9][^ ]*\) *.*#gcc-\1#p'
