/usr/ports/UPDATING has an entry on 20191216 for updating python to 3.7. There's a specific section in there describing how to do it if you're using portmaster. The instructions in that section do not work when using the default root shell. Specifically, the line... # REINSTALL="$(pkg info -o py36-\* | awk '{printf "%s ", $2}')" ... fails with "Illegal variable name." The instructions work fine if you switch to bash, but perhaps they should be changed to work in the default shell. At the very least, it should be noted in the UPDATING entry that the instructions require a specific non-default shell to be used.
The instruction is correct: This may ease the upgrade for users of pre-build packages: ==> # sh # for i in $(pkg query -g %n 'py36-*'); do pkg set -yn ${i}:py37-${i#py36-}; done # pkg upgrade The first command is "sh" the change to the sh-shell.
(In reply to Walter Schwarzenfeld from comment #1) The part you're quoting begins with "This may ease the upgrade for users of pre-build packages". I don't use pre-built packages, and so did not do that. I instead proceeded to the next step, "For portmaster users", as I do use portmaster. That portmaster section -- nor any other applicable section -- does not say to change shell. The way I followed these instructions is, I believe, consistent with a whole lot of /usr/ports/UPDATING instructions that I have successfully used in the past. They often have different sections for users of different port management schemes.
(In reply to Robert William Vesterman from comment #2) Robert, you are right! The portmaster section is wrong and sh is missing!
(In reply to Walter Schwarzenfeld from comment #1) The portmaster section was wrong and today, 02/06/2020 is wrong yet and misleading to errors for those using portmaster
...... For portmaster users: # sh # cd /usr/ports ......
A commit references this bug: Author: dbaio Date: Fri May 1 21:08:51 UTC 2020 New revision: 533589 URL: https://svnweb.freebsd.org/changeset/ports/533589 Log: Improve entry for Python 3.7 upgrade Portmaster instruction fails under default root shell. PR: 242964 Reported by: Robert William Vesterman <bob@vesterman.com> Changes: head/UPDATING
Thank you and sorry for the delay.