exec() and &

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bryan Andrews

    #1

    exec() and &

    At the shell you can always type "rm -rf /tmp/* &" and let the delete
    command run in the background. Is there a way to do this from a php
    shell script?

    I've tried `rm -rf /tmp/* &` ... but with the backticks it still
    waits for the command to finish before moving on to the next. I've
    also tried exec() with no luck. Anyone know any tricks?
  • Steve

    #2
    Re: exec() and &

    On Mar 14, 9:54 pm, Bryan Andrews <bryanandr...@g mail.comwrote:
    At the shell you can always type "rm -rf /tmp/* &" and let the delete
    command run in the background. Is there a way to do this from a php
    shell script?
    >
    I've tried `rm -rf /tmp/* &` ... but with the backticks it still
    waits for the command to finish before moving on to the next. I've
    also tried exec() with no luck. Anyone know any tricks?


    It's not really threading, but you can escape the parent process while
    the child is running.

    Comment

    • Bryan Andrews

      #3
      Re: exec() and &amp;

      On Mar 14, 7:33 pm, Steve <steve.h...@gma il.comwrote:
      On Mar 14, 9:54 pm, Bryan Andrews <bryanandr...@g mail.comwrote:
      >
      At the shell you can always type "rm -rf /tmp/* &" and let the delete
      command run in the background. Is there a way to do this from a php
      shell script?
      >
      I've tried `rm -rf /tmp/* &` ... but with the backticks it still
      waits for the command to finish before moving on to the next. I've
      also tried exec() with no luck. Anyone know any tricks?
      >

      >
      It's not really threading, but you can escape the parent process while
      the child is running.
      That worked great, thanks!

      Comment

      • good@respnse.sic.com

        #4
        Re: exec() and &amp;

        In article <1b3a9e06-a84d-4a95-a22a-
        d8cec47b4c2b@e2 5g2000prg.googl egroups.com>, bryanandrews@gm ail.com
        says...


        It's not really threading, but you can escape the parent process while
        the child is running.
        >
        That worked great, thanks!
        >
        Seconded - very interesting reading - thank you.

        Comment

        Working...