Both at work and at home I tend to do the following very often:
$ scp "SomeScriptIJustCreatedOrModified.sh" some-server:
$ ssh some-server ./SomeScriptIJustCreatedOrModified.sh arguments
And sometimes this variation too:
$ scp "SomeScriptIJustCreatedOrModified.sh" some-server:/tmp
$ ssh some-server -t sudo -u other_user /tmp/SomeScriptIJustCreatedOrModified.sh arguments
The thing is, the server is often in a different country and the SSH handshake usually takes at least a couple seconds --- and this apparent short wait can get old quickly, as well as get in the way for long lists of servers. Not only that, I have been berated before for making suspiciously quick sucessive SSH connections.
How to accomplish this?
.bashrc
?