I have just tried this script and it works within my environment.
Using HPUX 11.i with 3.8.1P
The resulting file Portfile.txt is not formatted for best viewing as the
column information is not lined up but I am not complaining just an
observation. It could be my HPUX Text editor that displays it incorrectly.
All the Port information is there.
Just one note that I think is obvious . Before running the script change the
TCL directory to match your version.
🙂 🙂