ok i seen the other questions and i don't think my question applies so here i go...... i'm a programmer just new to bash scripting i want to ssh into my amazon instance and then start my own .sh file pseudo:
{
ssh -i ...
cd /../
./blah.sh
profit!
}
I have multiple(5+) instances saved in a txt file that i would like to loop in so ultimately every instance would have its own ssh dialog.... the text file has the whole command
"ssh -i blah.pem ubuntu@ec2-blah.amazonaws.com"
UPDATE:
#!/bin/bash
while read LINE
do
[ ! -f /tmp/$(basename $0) ] && cp $0 /tmp/ && konsole -e $0 && exit
rm /tmp/$(basename $0) # open separate window for code to run
$LINE << EOF # read line (ssh cmd)
cd /st/task/ #commands during ssh
./start.sh #need something to let this run and go back to beginning of loop
EOF
done < pdns.txt
With your help i had gotten so far and this works... So my new problem is that after the first ssh operation executes it doesn't cycle to the next ssh operation because the start.sh
file doesn't end (by design). Need help!