Results 1 to 4 of 4

Thread: how to run a terminal command that will open automatically in a new terminal

  1. #1
    Join Date
    Jun 2011
    Location
    Bratislava, SVK
    Beans
    25
    Distro
    Ubuntu 11.04 Natty Narwhal

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

    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.

    SOLVED>

    the script with clogin could be replaced with the ssh or telnet command
    Code:
    nohup x-terminal-emulator  -e ssh $1 &
    Last edited by floorripper; June 19th, 2013 at 08:38 AM. Reason: logging in the new terminal window workks fine

  2. #2
    Join Date
    Mar 2010
    Location
    India
    Beans
    8,116

    Re: how to run a terminal command that will open automatically in a new terminal

    Quote Originally Posted by floorripper View Post
    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.
    Not 100% sure, but I hope this should work -
    Code:
    #!/bin/bash
    exec gnome-terminal -x clogin "$1"
    This will execute the "clogin" script in a new terminal (gnome-terminal), accepting whatever argument you supply ($1).

    If the "clogin" script further executes something that is needed to be done in a new terminal, something similar as above can be done with that too.
    Varun
    Help others by marking threads as [SOLVED], if they are. (See how)
    Wireless Script | Use Code Tags

  3. #3
    Join Date
    Jun 2011
    Location
    Bratislava, SVK
    Beans
    25
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: how to run a terminal command that will open automatically in a new terminal

    Hello thanks it works as well!
    I have managed it also with:

    nohup x-terminal-emulator -e clogin $1 &

  4. #4
    Join Date
    Mar 2010
    Location
    India
    Beans
    8,116

    Re: how to run a terminal command that will open automatically in a new terminal

    Quote Originally Posted by floorripper View Post
    Hello thanks it works as well!
    I have managed it also with:
    Code:
    nohup x-terminal-emulator -e clogin $1 &
    Nice! Didn't know of that 'nohup' command, looks simple but interesting.

    Please consider marking the thread as [Solved] now that it is. Helps others with similar problems.
    (follow the link in my signature to see how and why to mark threads [Solved].)
    Varun
    Help others by marking threads as [SOLVED], if they are. (See how)
    Wireless Script | Use Code Tags

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •