in reply to PleaSe WAIT for the process to end.

I'm a tad confused, what exactly does this (and pswait) do? Isn't the normal practice to wait untill an operation finishes and then return?
  • Comment on Re: PleaSe WAIT for the process to end.

Replies are listed 'Best First'.
Re: Re: PleaSe WAIT for the process to end.
by dominix (Deacon) on Jan 05, 2004 at 10:32 UTC
    exuse me, I didn't mention it as that was obvious to me with such a name.

    what pswait does : it waits for some [usualy backgrounded] process to end before quiting. So for example you can wait for a specific [backgrounded] wget/ncftp downloads to finish or for a bunch of similar process to terminate before launching another command:

    pswait httpd; backup.sh
    
    here backup.sh will be launched after all httpd deamons exited.
    pswait 10123; mail -s "picture processing terminated" me@home
    
    if you want an email alerting that your job 10123 is done
    This command is very usefull when working over slow networks links like dial up modems or when you have small number of process allowed on a system.
    Update: just added pod documentation.
    --
    dominix
      if (/--*sl*e*e*p*=(\d+)/i) { $sleeptime = $1; next } if (/--*ex*i*t*/i) { $endfirst = 1; next } if (/--*ve*r*b*o*s*e*/i) { $verbose = 1; next } if (/--*he*l*p*/i) {

      This is some really cool typo checking!


      --sleeeeeeeeeee
      --sleeeee
      --slp
      --sp

      Useful for intoxicated Unix users everywhere!

        I'm on the way off mastering GetOpt::Long, so in a few [put timeslice here] I'll change this to a better approach. BTW I'm also looking at POD in 5 minutes so it gonna get full featured system script :-)
        Update : Done - process consumed 1% cpu usage. perl has really EASY feature.
        --
        dominix