LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-16-2009, 05:09 PM   #1
ne00
LQ Newbie
 
Registered: Apr 2009
Posts: 9

Rep: Reputation: 0
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
 
Old 04-16-2009, 05:46 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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.
 
Old 04-16-2009, 08:56 PM   #3
ne00
LQ Newbie
 
Registered: Apr 2009
Posts: 9

Original Poster
Rep: Reputation: 0
I got it to work. The solution...

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsh xterm and running remote commands TomT_90GT Linux - Newbie 3 11-10-2007 12:45 AM
multiple shell commands Tylerious Programming 1 12-24-2005 07:53 PM
how to log user commands in xterm without using "script" command lilachb Linux - General 2 08-28-2005 02:08 AM
Multiple commands with exec! dtheorem Linux - General 1 03-14-2004 04:46 PM
chaining multiple commands?? puzz_1 Linux - General 9 05-27-2003 12:32 PM


All times are GMT -5. The time now is 04:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration