in reply to Re: Getting a script to re-run itself
in thread Getting a script to re-run itself
That way the script can move around on the filesystem and you won't need to hand edit it.exec $0 unless $all_done;
A warning: the above doesn't work correctly under Windows. For some reason, exec $0 spawns another copy of your script in the background. If you write a small test program like:
and run it, you get the effect of:print "hi!\n"; sleep 2; exec $0;
What exactly it is doing, I don't know :)H:\>test.pl hi! hi! H:\>hi! hi! hi!
mr.nick ...
|
|---|