Thanks, Josh, for the workaround. Using “sudo `readlink /opt/local/bin/port-tclsh` ./restore_ports.tcl” worked great.
++Eric The most straightforward workaround is to use a different path for the interpreter. /opt/local/bin/port-tclsh is a symlink to the actual tclsh8.6 in a subdirectory, so running the script like this should work: sudo `readlink /opt/local/bin/port-tclsh` ./restore_ports.tcl Hopefully we can ship automatic migration in MacPorts base soon and retire restore_ports.tcl. - Josh