Results 1 to 8 of 8

Thread: Open new terminal with and command in it

  1. #1
    Join Date
    Mar 2013
    Location
    Czech Republic
    Beans
    188
    Distro
    Xubuntu 14.04 Trusty Tahr

    Open new terminal with and command in it

    Hi, I have a program, that can be only launched from terminal, but I want this thing in menu list. I know how to add commands in menu list, but the program have to be launched from terminal. So.. I need a command, that will launch a new terminal and in the new terminal run command.
    Specifically the program I need to launch is "fp" and I have Xubuntu 12.10 using Terminal Emulator.
    Thank you for any help..

  2. #2
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Open new terminal with and command in it

    The name of the terminal emulator used in Xubuntu is xfce4-terminal. You can use its -x option to run a command in it:
    Code:
    xfce4-terminal -x "fp"

  3. #3
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Open new terminal with and command in it

    Code:
    xfce4-terminal -x fp

  4. #4
    Join Date
    Mar 2013
    Location
    Czech Republic
    Beans
    188
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Open new terminal with and command in it

    Thank you very much You have been very helpfull..

  5. #5
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Open new terminal with and command in it

    You can run it in a terminal like this
    Code:
    xterm -e command [options] [parameters]
    If you want it to stay after completion, use the hold option (otherwise you might not see the output of the command).
    Code:
    xterm -hold -e fp
    See
    Code:
    man xterm
    for all options.

    You can also use xfce4-terminal as described in the previous posts, but it has fewer options.
    Code:
    xfce4-terminal -e fp

  6. #6
    Join Date
    Mar 2013
    Location
    Czech Republic
    Beans
    188
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Open new terminal with and command in it

    By the way, what is the difference in those commands:
    Code:
    xfce4-terminal -x "fp"
    and
    Code:
    xfce4-terminal -x fp
    They look similar, but still different and it seems that both of them works.
    So why this?
    Code:
    " "

  7. #7
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Open new terminal with and command in it

    The double quotes (") can be used to make the command see a file name with spaces as one single parameter, and the shell will expand wild cards and interpret shell variables. If you enclose a string in single quotes ('), it works in the same way for spaces, and the shell will not expand or interpret anything.

    I think that in this case the quoting will make no difference.

  8. #8
    Join Date
    Mar 2013
    Location
    Czech Republic
    Beans
    188
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Open new terminal with and command in it

    Thank you for explaining sudodus..

Tags for this Thread

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
  •