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 - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-25-2007, 09:48 AM   #1
trscookie
Member
 
Registered: Apr 2004
Location: oxford
Distribution: gentoo
Posts: 463

Rep: Reputation: 30
opening a new shell?


hello all,

I am trying to write a script to open two different applications in different shells, however I can not figure out how to do it can someone please help this is what i have tried:

Code:
#!/bin/sh

xterm telnet firewall
gnome-terminal ssh <server_address>
However when I run this it doesn't open new shell's it just displays the help for the xterm and loads the ssh in the current instance of gnome-terminal. Help will be much appreciated.

Thanks, trscookie.
 
Old 07-25-2007, 10:21 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Code:
gnome-terminal -e "ssh <server-address>"
The terminal will close when exiting from the ssh session.
 
Old 07-25-2007, 10:40 AM   #3
trscookie
Member
 
Registered: Apr 2004
Location: oxford
Distribution: gentoo
Posts: 463

Original Poster
Rep: Reputation: 30
nice works a charm, thank you.
 
Old 07-25-2007, 10:56 AM   #4
gloriant
Member
 
Registered: Sep 2004
Distribution: Debian{Woody,Sarge,Etch}, UbuntuLTS6.06, SuSE{6.2,8.0}
Posts: 42

Rep: Reputation: 16
I believe both lines (xterm and gnome-terminal) should have the '-e' option prior to the command, AND the xterm instruction should be followed by '&' to launch it in background. gnome-terminal puts itself in background without a problem. So I guess - apart from the fact that you seem to have the hang of it already - you actually want:

Code:
#!/bin/sh
set firewall=hostname.of.firewall;
set sshserver=hostname.of.sshserver;

xterm -e "telnet ${firewall}" &
gnome-terminal -e "ssh ${sshserver}";
 
  


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
LXer: Shell tip: Set the shell prompt and themes in Linux Terminal LXer Syndicated Linux News 0 06-12-2007 03:02 AM
'sh' shell - Actually calls legacy Bourne shell, or uses system default? Dtsazza Linux - Software 1 10-28-2005 09:20 AM
opening a program from shell hari78 Linux - Newbie 4 03-08-2005 09:33 AM
opening file with .xls on linux shell prompt suchi_s Programming 1 07-28-2004 07:40 AM
Opening file with default application from shell script? bourbon_beast Programming 4 04-13-2004 01:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:24 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