LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-29-2010, 03:15 PM   #1
JoeJoe
LQ Newbie
 
Registered: Jun 2010
Posts: 22

Rep: Reputation: 16
run something not attached to xterm


I prepared this small script, its like this


#!/bin/bash
#restart the stuck firefox

killall firefox
sleep 5
firefox
done

it fires firefox but it doesn't ends before I close firefox,

What I want it to do is this script to fire up a firefox and close itself, I want firefox to keep running even if I close that xterm, just like firefox started from gnome panel.

I would also love if someone explains what actually happens when i click firefox icon from gnome, does it run unattached or does it run attached to tty7 or tty1 ?
 
Old 06-29-2010, 03:26 PM   #2
jrtayloriv
Member
 
Registered: Jun 2004
Location: Inland NW, US
Distribution: Ubuntu
Posts: 365
Blog Entries: 1

Rep: Reputation: 44
Do
Code:
nohup firefox
instead of
Code:
firefox
... this will prevent it from closing firefox when you close the terminal.

See man nohup for more details

Last edited by jrtayloriv; 06-29-2010 at 03:29 PM.
 
Old 06-29-2010, 03:28 PM   #3
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
firefox &

Or if this is on fedora, and firefox is the default browser, you can run htmlview which is a helper program.
Try opening a terminal and running htmlview and see what happens.
 
Old 06-29-2010, 03:51 PM   #4
JoeJoe
LQ Newbie
 
Registered: Jun 2010
Posts: 22

Original Poster
Rep: Reputation: 16
nohup got the job done, is there anything I should know about it, is it secure use on a server for other purposes,

edit: it didn't worked as I wanted on script, still after execution of firefox script stands still, it doesn't ends,


is it possible to pass an command to gnome "Run Application" (alt-f2) from a shell?

Last edited by JoeJoe; 06-29-2010 at 03:57 PM.
 
Old 06-29-2010, 04:40 PM   #5
jrtayloriv
Member
 
Registered: Jun 2004
Location: Inland NW, US
Distribution: Ubuntu
Posts: 365
Blog Entries: 1

Rep: Reputation: 44
Code:
nohup firefox &
 
Old 06-30-2010, 02:27 AM   #6
JoeJoe
LQ Newbie
 
Registered: Jun 2010
Posts: 22

Original Poster
Rep: Reputation: 16
"nohup firefox &" got the job done
 
Old 06-30-2010, 03:36 AM   #7
JoeJoe
LQ Newbie
 
Registered: Jun 2010
Posts: 22

Original Poster
Rep: Reputation: 16
pass a command to gnome "Run Application"

is it possible to pass a command to gnome "Run Application" from a shell?
 
Old 06-30-2010, 04:45 AM   #8
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
Hi JoeJoe,

Not sure what you mean - do you mean initialize a GNOME/GUI session from a terminal session? If that's the case CTRL-ALT-F7 will do this in Fedora/RHEL/CentOS.

Alternately, from a terminal session issuing the following command will startup a GUisession:

Code:
# init 5
 
Old 06-30-2010, 05:27 AM   #9
JoeJoe
LQ Newbie
 
Registered: Jun 2010
Posts: 22

Original Poster
Rep: Reputation: 16
The thingy which opens with alt+f2 at gnome, the run application dialog, can I pass a command to it from a terminal?
 
Old 06-30-2010, 06:23 AM   #10
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by JoeJoe View Post
The thingy which opens with alt+f2 at gnome, the run application dialog, can I pass a command to it from a terminal?
I am not sure what are you exactly trying to do.

If you want to run, let's say, firefox from a terminal, why not just launch "firefox" from the command line instead of using that toy in the middle?
 
Old 06-30-2010, 07:06 AM   #11
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
Quote:
If you want to run, let's say, firefox from a terminal, why not just launch "firefox" from the command line instead of using that toy in the middle?
Exactly - if you wish to run an application; you don't need a "Run" dialog - from the terminal you can execute the binary which will run the application.
 
Old 06-30-2010, 07:38 AM   #12
JoeJoe
LQ Newbie
 
Registered: Jun 2010
Posts: 22

Original Poster
Rep: Reputation: 16
i need the software to run exacly as I clicked it from GUI, independently,without a terminal hanging around the screen (ps: nohup doesn't works in my target PC,)
 
Old 06-30-2010, 08:41 AM   #13
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Quote:
Originally Posted by JoeJoe View Post
i need the software to run exacly as I clicked it from GUI, independently,without a terminal hanging around the screen (ps: nohup doesn't works in my target PC,)
You may try disown:
Code:
$ xclock &
[1] 9982
$ disown $!
$ exit <closed terminal, xclock still running, hopefully...>
 
Old 06-30-2010, 08:54 AM   #14
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,090
Blog Entries: 3

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
I just run
Quote:
firefox & exit
works fine for me.
 
Old 06-30-2010, 09:04 AM   #15
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
Hi

You can also run in a screen:

Code:
# screen
# xclock
After doing the above the xclock should be running. Thereafter you hit CTRL+A+D and this will detach you from the screen with the xclock still running. Exiting the terminal should leave the xclock still running.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I scan a network attached drive with Amarok's first run wizard for media? beeblequix Linux - Newbie 4 01-05-2009 09:31 PM
Can't get a remote xterm to run markseger Linux - Software 3 12-05-2008 05:18 PM
start xterm and run command? P-P Linux - Software 3 01-19-2007 07:35 PM
Xterm to Graphical Environment: run what? JMCraig Linux - Newbie 3 01-24-2005 04:12 PM
can't run X11 programs from xterm Sin-D Linux - General 4 12-18-2003 12:55 PM


All times are GMT -5. The time now is 08:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration