[clug] ssh to box, run shell command, then leave shell open?

Carlo Hamalainen carlo.hamalainen at gmail.com
Fri Apr 15 00:19:22 MDT 2011


On Fri, Apr 15, 2011 at 4:15 PM, Andrew Janke <a.janke at gmail.com> wrote:
> try this:
>
> ---
>
> #! /usr/bin/expect -f
>
>
> spawn ssh cai-george
>
> # wait for the prompt
> expect "$"
> send -- "hostname\n"
>
> interact
>
> ---

Brilliant! Thank you!

-- 
Carlo Hamalainen
http://carlo-hamalainen.net


More information about the linux mailing list