But will we not have to address this problem earlier? At Line 25, I think, because the cd trinityrnaseq* will open the first match, and that is a problem if we have multiple versions.

What if we create a symlink to the latest version that we have extracted and use that to access Trinity.pl?