PDA

View Full Version : bash waiting for background tasks



frankdn
September 9th, 2012, 03:01 PM
It's been a while (years!) since I did any shell programming... which makes me a novice again.

I run a startup script at login. I've recently added a 'find' command:

#!/bin/bash

...blah

nohup find $HOME -iname wifiadapt -delete &

The command works but despite backgrounding the nohup, bash waits for 'find' to exit... which I don't want. What have I forgotten?

iponeverything
September 9th, 2012, 03:14 PM
It's been a while (years!) since I did any shell programming... which makes me a novice again.

I run a startup script at login. I've recently added a 'find' command:

#!/bin/bash

...blah

nohup find $HOME -iname wifiadapt -delete &

The command works but despite backgrounding the nohup, bash waits for 'find' to exit... which I don't want. What have I forgotten?

perhaps add a "disown %1" after backgrounding.

frankdn
September 11th, 2012, 05:59 PM
Thanks, but that didn't help.

ofnuts
September 12th, 2012, 05:28 PM
It's been a while (years!) since I did any shell programming... which makes me a novice again.

I run a startup script at login. I've recently added a 'find' command:

#!/bin/bash

...blah

nohup find $HOME -iname wifiadapt -delete &

The command works but despite backgrounding the nohup, bash waits for 'find' to exit... which I don't want. What have I forgotten?
Hmmm. Waiting for "find" or for "nohup"? How can bash tell that "find" is an executable?