Re: creating a new gnome terminal, running a command when the term starts...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 28Sep2009 11:17, bruce <bedouglas@xxxxxxxxxxxxx> wrote:
| I'm trying to create/invoke a new gnome-terminal, were i start/run a script
| when the term starts up..
| 
| from the gnome-terminal docs, i'm assuming i can accomplish this by using
| the "-x/-e" attribute when i fire up gnome-terminal...
| 
| this doesn't work... others appear to have the same issue...
| 
| so, when i do:
| 	gnome-terminal -x "foo"
| 
| a new gnome term is created, but it hangs without a bash prompt (or any
| prompt) created.

Of course not. You're running "foo". It's _still_ a terminal!
Sounds like correct behaviour to me.

| so it appears that a useless blank term window is displayed. the "foo"
| script is simply an empty script for testing. it has the chgrp of 777 with a
| chown of 777 and a chmod of +x.

Try this:

  gnome-terminal -e sh -c 'foo & exec $SHELL'
or:
  gnome-terminal -e 'foo & exec $SHELL'

The -e option _ought_ to take a command-and-arguments like xterm
does, thus the 'sh -c '....'" invocation. But I have in the back of
my mind that gnome-terminal got this wrong so I've supplied you the
"-e shell-command-string" variation as well.

You might prefer 'foo; exec $SHELL', depending on your needs.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

Your eyes are weary from staring at the CRT.  You feel sleepy.  Notice how
restful it is to watch the cursor blink.  Close your eyes.  The opinions
stated above are yours.  You cannot imagine why you ever felt otherwise.
        - gabrielh@xxxxxxxxxxxxxxx

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux