Find the answer to your Linux question:
Results 1 to 4 of 4
I wrote a script (sh) to launch a titled terminal based on some environment variables. NAME=` (run a sed command to parse out a name) ` gnome-terminal -t="$NAME:$HOST" It works ...
  1. #1
    Just Joined!
    Join Date
    Nov 2011
    Location
    Boulder CO
    Posts
    2

    unwanted terminal

    I wrote a script (sh) to launch a titled terminal based on some environment variables.

    NAME=` (run a sed command to parse out a name) `
    gnome-terminal -t="$NAME:$HOST"

    It works fine, but here's the catch; when run using a launcher, the parent terminal occasionally hangs around for no apparent reason (in addition to the one launched by the line above). Any ideas on why this happens, and how to make the parent go away?

    Thanks in advance

  2. #2
    Trusted Penguin Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,393
    How about setting the gnome-terminal to run as a background task by putting an ampersand at the end of its line?

    Code:
    NAME=` (run a sed command to parse out a name) `
    gnome-terminal -t="$NAME:$HOST" &
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Just Joined!
    Join Date
    Oct 2007
    Posts
    8
    Just a thought, maybe try running the gnome-terminal -t="$NAME:$HOST" inside of an exec(1) call like this:

    exec gnome-terminal -t="$NAME:$HOST"

    That will force the parent process to die (the script that contains this command line.)
    -Col P

  4. #4
    Just Joined!
    Join Date
    Nov 2011
    Location
    Boulder CO
    Posts
    2
    I tried these as well as a few other suggestions, and wasn't having too much luck. I ended up adding a precmd() for gnome-terminal that dynamically sets the title, which is closer to what I wanted than my solution above anyway.

    thanks!

Posting Permissions

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