I have a workflow where I am trying to do the following: For a given existing SSH session, access the remote machinne and perform a process from which a port is returned (e.g. a remote daemon has been started). Using this port, I would like to create a new port forward from within the existing session by using the EscapeChar technique to instantiate an SSH shell within the session and construct the new port forward. My question is the following: How do I -- from a shell script or equivalent -- programatically perform SSH session modifications wherein the EscapeChar is required. 
Programatically / dynamically adjust SSH session port forwards
bash;shell script;ssh;ssh tunneling;openssh