FAQ
"gnome-terminal --tab-with-profileªA --tab-with-profile»B"

Hi I am trying to open several tabs in a gnome-terminal window like above. I
want to run a command for each tab within the body of the above command. AAA and
BBB are both profiles I have created and also predefined environment variable on
my system (each representing a path to a folder). The code I was hoping would
work was something like:

"gnome-terminal --tab-with-profileªA -e='ls AAA' --tab-with-profile»B -e='ls
BBB'"

in order to list the folder contents within each tab, but no dice.

Anyone know how to do this in a single command?

Thanks
Pete

Search Discussions

  • John Doe at Aug 3, 2011 at 7:04 am
    From: Pete O'Connell <pedrooconnell at gmail.com>
    Hi I am trying to open several tabs in a gnome-terminal window like above. I
    want to run a command for each tab within the body of the above command. AAA and
    BBB are both profiles I have created and also predefined environment variable on
    my system (each representing a path to a folder). The code I was hoping would
    work was something like:

    "gnome-terminal --tab-with-profileªA -e='ls AAA'
    --tab-with-profile»B -e='ls
    BBB'"

    in order to list the folder contents within each tab, but no dice.
    I think the problem is more that it exits right away and does not seem to accept chained commands with ; or &&...
    Try with a full script with loops or something like watch:
    gnome-terminal --tab -e "watch ls /" --tab -e "watch ls /"

    JD
  • Pete O\'Connell at Aug 4, 2011 at 7:50 pm
    HI, but using watch you don't get the cursor back.
    John Doe said:
    Try with a full script with loops

    Sounds good how do I do that?
  • Tom De Vylder at Aug 5, 2011 at 3:54 am
    Or just use Terminator and broadcast to all split windows or tabs.

    -- Tom
    On 05 Aug 2011, at 01:50, Pete O'Connell wrote:


    HI, but using watch you don't get the cursor back.
    John Doe said:
    Try with a full script with loops

    Sounds good how do I do that?

    _______________________________________________
    CentOS mailing list
    CentOS at centos.org
    http://lists.centos.org/mailman/listinfo/centos
  • John Doe at Aug 5, 2011 at 6:34 am
    From: Pete O\'Connell <pedrooconnell at gmail.com>
    HI, but using watch you don't get the cursor back.
    Because when the command exists, the gnome-terminal session exists...
    Best would be the following if you find out how to add your commands to the bash call...
    ? gnome-terminal --tab -e "bash -i" --tab -e "bash -i"
    Maybe someone will have an idea...
    Try with a full script with loops
    Sounds good how do I do that?
    Instead of the loops, you could use this script.sh:
    ? #!/bin/bash
    ? ls $*
    ? bash -i

    ? gnome-terminal --tab -e "/path/to/script.sh AAA" --tab -e "/path/to/script.sh BBB"

    JD
  • Pete O'Connell at Aug 5, 2011 at 9:31 pm
    hi, bash is unavailable to me on my machine unfortunately
    (it is a work machine) the command
    must be sent in a tsch shell. any way to do this in tsch?

    Pete
  • John Doe at Aug 8, 2011 at 5:53 am
    From: Pete O'Connell <Pedrooconnell at gmail.com>
    hi, bash is unavailable to me on my machine unfortunately
    (it is a work machine) the command
    must be sent in a tsch shell. any way to do this in tsch?
    Did you look at tcsh man page?
    If you did, you must have noticed that it accepts the same '-i'
    parameter as does bash.
    So did you just try to replace the bash calls with tcsh calls...?

    JD

    PS: It is strange that your CentOS server has no bash installed...
  • Pete O\\\'Connell at Aug 11, 2011 at 9:23 pm
    Hi swapping out bash for tsch doen't work unfortunately. The window that gets
    created when you do this only stays open for a split second. You are right, bash
    is on the Centos server, it is just that the many custom environment variables
    at my workplace only work in a tsch shell. Anyone know a way of doing this using
    only tsch?

    Pete
  • John Doe at Aug 16, 2011 at 7:04 am
    From: Pete O\\\'Connell <pedrooconnell at gmail.com>
    Hi swapping out bash for tsch doen't work unfortunately. The window that
    gets created when you do this only stays open for a split second.
    Works for me with:
    ? $ cat test.sh
    ? #!/bin/tcsh
    ? ls $*
    ? /bin/tcsh -i
    ? $ gnome-terminal --tab -e "/path/to/test.sh AAA" --tab -e "/path/to/test.sh BBB"
    Be sure to use the script full path...

    JD

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcentos @
categoriescentos
postedAug 3, '11 at 1:18a
activeAug 16, '11 at 7:04a
posts9
users3
websitecentos.org
irc#centos

People

Translate

site design / logo © 2022 Grokbase