Sublime text 2 - How to run a shell command over ssh?
bash, editor, sublimetext2
Solution
I'll answer my own question. You can easily create a build pointing to any script, so all I had to do was create `myscript.sh` containing :
#!/bin/bash
ssh root@192.168.0.2 "tail -10 /var/log/httpd-error-user.log"
And then create a new Build System in ST2 to call it :
{
"cmd": ["./myscript.sh"]
}
Note : In this example (i'm on Linux), `myscript.sh` is located in `/home/mike/.config/sublime-text-2/Packages/User/`
Problem
I'm new to Sublime Text 2 and there's something I haven't figured out yet, how can I run a bash command over SSH ? For example, to view the Apache error log on my dev server, I'd like to be able to run : ``` ssh root@192.168.0.2 "tail -10 /var/log/httpd-error-user.log" ``` Instead of having to open a terminal, I'd like to run this from within the editor with a keyboad shortcut. I've read about build systems, but I'm not sure it's the way to go, also it seems to allow only one command.