I would like to save the keystrokes I make to ssh into a server (with a开发者_运维问答 ssh public key) and tail a log file. What's the easiest way to do this. Is there a shell script that can do this, or if not, a short Ruby script?
Any reason not to use ssh itself ? ssh server "tail logfile" ?
Or if it's more complicated 'expect' is good for scripting interactive commands.
You can pass a command to the ssh command, instead of starting a shell. (Just add the command after the hostname)
Then it's easy to setup an alias
for that ssh command.
精彩评论