Results 1 to 4 of 4

Thread: bash waiting for background tasks

  1. #1
    Join Date
    May 2008
    Beans
    29

    bash waiting for background tasks

    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?

  2. #2
    Join Date
    Aug 2008
    Location
    WA
    Beans
    2,186
    Distro
    Ubuntu

    Re: bash waiting for background tasks

    Quote Originally Posted by frankdn View Post
    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.

  3. #3
    Join Date
    May 2008
    Beans
    29

    Re: bash waiting for background tasks

    Thanks, but that didn't help.

  4. #4
    Join Date
    Aug 2011
    Location
    47°9′S 126°43W
    Beans
    2,165
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: bash waiting for background tasks

    Quote Originally Posted by frankdn View Post
    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?

Tags for this Thread

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
  •