LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 04: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, 04:46 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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, 07: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



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-09-2007 11:45 PM
multiple shell commands Tylerious Programming 1 12-24-2005 06:53 PM
how to log user commands in xterm without using "script" command lilachb Linux - General 2 08-28-2005 01:08 AM
Multiple commands with exec! dtheorem Linux - General 1 03-14-2004 03:46 PM
chaining multiple commands?? puzz_1 Linux - General 9 05-27-2003 11:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Open Source Consulting | Domain Registration