I find myself performing this REPL-like action quite often:
vim foo.sh scp foo.sh host:/tmp/foo.sh ssh host /tmp/foo.sh # realizing it wasn't quite right vim foo.sh scp foo.sh host:/tmp/foo.sh ssh host /tmp/foo.sh # repeat many times
I was about to plow away at writing a shell script to make this simpler, but was wondering if someone smarter than me solved this problem more elegantly.
What's your solution? Besides emacs :)
EDIT: Why not just edit my file on the remote host? Simple, the hosts receiving my scripts won't always have a dev environment set up, so in this case host might not have all of my vim customizations; sometimes it'll be C code instead of a shell script, which means my workflow looks like:
vim foo.c make scp foo host:/tmp/foo ssh host /tmp/foo # repeat
That's why. I guess I want something with an interface like:
edit_loop foo.c --make --copy-and-run=host:/tmp/foo
What do you think?