LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   opening a new shell? (https://www.linuxquestions.org/questions/linux-software-2/opening-a-new-shell-572169/)

trscookie 07-25-2007 09:48 AM

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.

colucix 07-25-2007 10:21 AM

Code:

gnome-terminal -e "ssh <server-address>"
The terminal will close when exiting from the ssh session.

trscookie 07-25-2007 10:40 AM

nice works a charm, thank you.

gloriant 07-25-2007 10:56 AM

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}";



All times are GMT -5. The time now is 10:58 PM.