Results 1 to 9 of 9
I know the & character can be tagged after an application name to keep the shell prompt (perhaps this opens the app in a new session). However I am not ...
- 07-01-2005 #1Linux Newbie
- Join Date
- May 2005
- Posts
- 127
Using the & command to launch an application and keep the shell
I know the & character can be tagged after an application name to keep the shell prompt (perhaps this opens the app in a new session). However I am not sure how to use this when the app has parameters after it.
For instance, I'm trying to do:
while keeping my shell usable, however nietherCode:pppd dial mymodem
norCode:pppd & dial mymodem
work. Anyone know the correct syntax to do this?Code:pppd dial mymodem &
Thanks.
- 07-01-2005 #2Linux Guru
- Join Date
- May 2004
- Location
- forums.gentoo.org
- Posts
- 1,814
If I do
it works like I would expect: gedit starts per the argument and the terminal is available once gedit is launched. Maybe pppd doesn't want to play that way....Code:# gedit /etc/inittab &
/IMHO
//got nothin'
///this use to look better
- 07-01-2005 #3Just Joined!
- Join Date
- Jun 2005
- Location
- San Francisco, CA
- Posts
- 54
Re: Using the & command to launch an application and keep the shell
What it does is that it runs the command in the background. I think you can get the command back into the foreground (and tying up your shell session) with the fg (foreground) command.
Originally Posted by ngmlinux
- 07-01-2005 #4Linux Newbie
- Join Date
- May 2005
- Posts
- 127
Are you suggesting I try something like
?Code:pppd & fg dial mymodem
- 07-01-2005 #5Linux Guru
- Join Date
- May 2004
- Location
- forums.gentoo.org
- Posts
- 1,814
The ampersand (&) should be at the end of the command. You can translate the '&' to mean "and do (the preceding command) in the background". You do not want "fg" in your command line: that's used only when you want to bring the process (the one you started with "the preceding command") back to the foreground.
Of course the command itself has to be right: if you run 'pppd dial mymodem', do you get the correct results? If so, then I guess you want to enter 'pppd dial mymodem &'. If you don't get the correct results without the '&', you need to look at your command first.
http://linux.about.com/od/glossary/l..._bgprocess.htm/IMHO
//got nothin'
///this use to look better
- 07-01-2005 #6Just Joined!
- Join Date
- Jun 2005
- Location
- San Francisco, CA
- Posts
- 54
That's right (what drakebasher said).
- 07-02-2005 #7Linux Newbie
- Join Date
- May 2005
- Posts
- 127
Command itself runs fine, but doesn't when I add the & to the end.
- 07-02-2005 #8Just Joined!
- Join Date
- Jun 2005
- Location
- San Francisco, CA
- Posts
- 54
What happens wrong when you run the command with the & ?
- 07-02-2005 #9Linux Engineer
- Join Date
- Nov 2004
- Location
- Ft. Polk, LA
- Posts
- 796
pppd updetach dial mymodem
Try that


Reply With Quote
