LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Multiple commands using xterm? (https://www.linuxquestions.org/questions/linux-newbie-8/multiple-commands-using-xterm-719669/)

ne00 04-16-2009 04:09 PM

Multiple commands using xterm?
 
Is there a way to run multiple commands using xterm?

This is what I'm trying to do...

Open a new window and ssh into the machine spc10

Code:

xterm -e "ssh spc10; bash" &
I want to be able to add another command to execute a shell script after the ssh as I have a script on that machine to run. I tried the following with no success. Not sure if xterm supports multiple command options.

Code:

xterm -e "ssh spc10; . script.sh; bash" &
Any suggestions?

Thanks

David

Tinkster 04-16-2009 04:46 PM

Ummm ... that isn't going to fly in the first place, because
the ; tells the *local* shell to execute the . and so forth
*after* the ssh connection has been torn down again.

ne00 04-16-2009 07:56 PM

I got it to work. The solution...

Code:

xterm -e "ssh spc10 '. script.sh'; bash" &


All times are GMT -5. The time now is 11:40 AM.