LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   how to run a terminal command that will open in a new terminal automatically (http://www.linuxquestions.org/questions/linux-general-1/how-to-run-a-terminal-command-that-will-open-in-a-new-terminal-automatically-4175466334/)

floorripper 06-17-2013 08:32 AM

how to run a terminal command that will open in a new terminal automatically
 
Hello,

I am trying to log in into a device.

I have written a script which logs me in into another system,router via ssh.
When go to the router, and I make "show users" I see my new established ssh session on the new VTY. So he makes it subtle.


Code:

#!/bin/bash
#
clogin $1

clogin is my automatic login script, which comes from a Rancid package,it runs on echo,expect. But that's run fine. It also takes the variable. TCP session is established but I do not see it in the new terminal.
That's the main point. I need it to open a new window automatically and to log me in this window.

Ygrex 06-17-2013 09:24 AM

this line runs a terminal emulator on the current display and executes SSH in it:
Code:

x-terminal-emulator -e 'ssh localhost.localdomain' &

smallpond 06-17-2013 09:29 AM

Try:

Code:

nohup xterm -e clogin $1 &

floorripper 06-18-2013 04:15 AM

Quote:

Originally Posted by smallpond (Post 4973447)
Try:

Code:

nohup xterm -e clogin $1 &


hello, thanks, this one works fine thank you!!! One last question how to use it with gnome-terminal, so i can use my default font/color settings and so one.

I have tried
Code:

nohup /usr/bin/gnome-terminal -e clogin $1 &
but that does not work :confused:

Ygrex 06-18-2013 04:26 AM

you missed quotes, they are in example…

floorripper 06-18-2013 04:36 AM

Quote:

Originally Posted by Ygrex (Post 4973996)
you missed quotes, they are in example…

Hello yes this works fine for a GUI gnome terminal emulator:

Code:

nohup x-terminal-emulator  -e clogin $1 &
tank you so much guys, this script works unless I have route to the desired subnet. I will try to modify it when wee need to use a "hopping station". Then I will post again.


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