This question:
https://superuser.com/questions/355029/linux-how-to-automatically-run-commands-on-ssh-login#355030
Only tells me how to run static commands. What it does not tell me is how I can feed it parameters. So say for example, I would like something like this to happen:
$ ssh [email protected] -p 2222 --parameter1 "boat programming"
Last login: Sat Dec 10 03:59:37 2016 from some place
boat programming
# .bashrc executes something like this:
echo $parameter1
If I have to use a language like expect, fine, but ideally I would like to keep this straightforward and simple.
#!/bin/bashscript. I tried doing what you said, having an auto ssh login followed by an echo command, however the command only executed after I exited my ssh session.