I\'m trying to write a Bash script that will SSH into a machine and create a directory. The long-term goal is a bit more complicated, but for now I\'m starting simple. Howev
Your script is doing substitution on the local host before being sent over.
Change your first line to:
ssh -T tunneluser@111.222.333.444 <<'EOI'
This will cause the raw script to get sent over and interpreted on your remote host.
If you wanted a mix (so for example, if you wanted the date command executed on your local host, you should leave ssh line unchanged and quote the individual command):
ssh -T tunneluser@111.222.333.444 <