Results 1 to 8 of 8

Thread: Running a program in a console?

  1. #1
    Join Date
    Nov 2008
    Beans
    109

    Running a program in a console?

    Hi

    I am using a gui app that can run other apps in case of a trigger event. It works well however I would like to see the console out put of the called app. In this case the gui app calls "unison" when there is a change. The app calls Unison and Unison runs well but it all happens in the background and I do not know what is going on. So I would like unison to run in a console when the app cals it.

    any ideas?

    thanks

  2. #2
    Join Date
    Mar 2008
    Location
    Birmingham, UK
    Beans
    Hidden!

    Re: Running a program in a console?

    To run 'top' in 'gnome-terminal' for example:
    Code:
    gnome-terminal -x top
    Or in xterm:
    Code:
    xterm -e top
    Desktop: Phenom 955 BE | GA-MA790XT-UD4P | 8GB TG Elite 1600 | BFG GTX 275
    Conky Screenshots | Last.fm | New to Ubuntu?

  3. #3
    Join Date
    Feb 2008
    Location
    Greece
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Lightbulb Re: Running a program in a console?

    You can always run a gui program by typing it's full name in a console.That way you can keep track of what is going in the background including most of the times the programs that this particular app calls.

  4. #4
    Join Date
    Jan 2007
    Location
    US, Michigan
    Beans
    186
    Distro
    Kubuntu

    Re: Running a program in a console?

    You could have your app run that command in a terminal like this,

    Code:
    xterm -e unison
    OR
    gnome-terminal -e unison
    OR
    terminator -e unison
    And that will run it in a terminal. Depending on which terminal app you use, I've found that most support -e to run a command.

    Hope this helps.

    edit: doh, I was too slow. lol
    Desktop | Intel Core 2 Quad Q8200 @ 2.33GHz | 320GB + 640GB HDD | 4GB RAM | NVIDIA GeForce GTS 250
    Dell Mini 9 | Intel Atom N270 @ 1.6GHz | 16GB SSD + 16GB SD Card | 2GB RAM | 1.3MP Cam + Bluetooth | Intel GMA 950

  5. #5
    Join Date
    Nov 2008
    Beans
    109

    Re: Running a program in a console?

    Hi

    thank you for all the great answers. I tried all and it seems like "xterm" is the one that works for me

    I have one final question. I tried looking into xterm`s help and cannot figure out.

    Is there a way to keep the console window open? Unison runs in console but as soon as its done the xterm shell closes as well.

    thanks

  6. #6
    Join Date
    Mar 2008
    Location
    Birmingham, UK
    Beans
    Hidden!

    Re: Running a program in a console?

    Assuming your shell is bash, the following works:
    Code:
    xterm -e "top && bash"
    Ref: LQ Link
    Desktop: Phenom 955 BE | GA-MA790XT-UD4P | 8GB TG Elite 1600 | BFG GTX 275
    Conky Screenshots | Last.fm | New to Ubuntu?

  7. #7
    Join Date
    Nov 2009
    Beans
    67

    Re: Running a program in a console?

    man xterm -

    -hold Turn on the hold resource, i.e., xterm will not immediately
    destroy its window when the shell command completes. It will
    wait until you use the window manager to destroy/kill the win-
    dow, or if you use the menu entries that send a signal, e.g.,
    HUP or KILL.

  8. #8
    Join Date
    Nov 2008
    Beans
    109

    Re: Running a program in a console?

    Hi

    It looks like xterm -hold is exactly what I was looking for.


    thanks again

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
  •