Run intractive ssh session in a bash script
I'm trying to create a really simple, no-frills script that opens up multiple ssh sessions to multiple servers, and I'm trying to make it all happen in a single Terminal session in multiple Terminal tabs. In addition, I am trying to learn bash scripting and trying to make my script as generic as possible, with the only changes being the command being run (so I can reuse my script/share it).
Anyway, like I said, I'm still learning, and following one the HOW-TOs on http://www.tldp.org So feel free to explain where I'm missing the "point".
Here's what I've got:
I've got auth keys setup, so it's not waiting for password input, it just seems 'stuck'. I've seen various scripts around for running remote commands through ssh in scripts, but none of them work for just opening up an ssh session and keeping it open.
Any thoughts? And I know there are a couple thousand of you genius folks who could write this up for me, and if you do, thanks. But I'd very much like to learn what I'm doing wrong, and if you write it up different, I'd like to learn how your version works; so please be verbose in your response.
ssh is rather suspicious - it checks kind of its input file descriptor sometimes.
Does just 'Terminal --command ssh ...' work? Try prepending 'strace -f -o log' and see what ssh actually checks about it. You can even take chances and strace your entire script.
Hey, that's a great idea! Thanks for the response, I think I'm having problems sending the ssh command string as a whole; it seems terminal is taking the parameters that I send to ssh as being sent to Terminal.
Thanks a ton, I think I can work on it further/figure it out from here.
Excellent! It was as stupid as using double quotes instead of backticks... Again, thanks for the help.
|All times are GMT -5. The time now is 08:40 AM.|