View previous topic :: View next topic |
Author |
Message |
l_bratch Guru
Joined: 08 Feb 2005 Posts: 494 Location: Jersey
|
Posted: Sun Jun 20, 2010 9:08 pm Post subject: Background any command, and then exit, using bash |
|
|
Hi there
Is there a way to get bash to automatically put every command issued to it in the background, and then get bash to exit?
e.g. I want to type "gftp", have gftp open, and then have bash (and xterm) exit, leaving gftp running.
Specifically I am trying to create a "Run" dialogue using bash and xterm. I have a small xterm window with no prompt text. I want to simply type a command in there, have it run and stay running, while the xterm window closes.
Appending every command with "& exit" does exactly what I want. Perhaps the easiest way to achieve what I want would be to find some mechanism for that to happen automatically - although I wouldn't want to ruin bash's history, as that's a big part of why I wanted to create a new "Run" dialogue in the first place.
Thanks
Luke |
|
Back to top |
|
|
marens Apprentice
Joined: 05 Aug 2004 Posts: 173
|
Posted: Sun Jun 20, 2010 9:43 pm Post subject: |
|
|
Code: | HISTIGNORE=spanwAndExit*
function spawnAndExit() {
nohup $@ >> /dev/null &
exit
}
spawnAndExit gedit /home/l_bratch/file |
check gmrun or dmenu for really simple application launchers _________________ If English was good enough for Jesus, then it's good enough for you! |
|
Back to top |
|
|
joshuar n00b
Joined: 17 Dec 2008 Posts: 3
|
|
Back to top |
|
|
l_bratch Guru
Joined: 08 Feb 2005 Posts: 494 Location: Jersey
|
Posted: Sun Jun 20, 2010 11:28 pm Post subject: |
|
|
Thank you both. dmenu looks so fantastic that after a couple of hours playing, I'm very happy with it for my purposes. |
|
Back to top |
|
|
Yamakuzure Advocate
Joined: 21 Jun 2006 Posts: 2284 Location: Adendorf, Germany
|
Posted: Tue Jun 22, 2010 1:20 pm Post subject: |
|
|
Or maybe you want to take a look at app-misc/screen _________________ Important German:- "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
- "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
|
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
|
Back to top |
|
|
|