If the shell interpreting the script truly does not get to
echo …
then it's a problem (bug?) with the shell; it shall get there no matter what open
s do. Is this an old Bash? Try an up-to-date shell. But maybe the shell gets to echo …
. If any of your open
s or their descendants prints to the terminal then … opened.
may appear earlier. Can it be you miss it? Processes in the background may even print control sequences that make the terminal "misbehave" and "overwrite" earlier text or not show later text. Do your background jobs print a lot?