|
|
|
|
|
by tyingq
1582 days ago
|
|
The BEGIN block only runs once. That is: while (1) {
BEGIN {print "hello\n"}
sleep 1;
}
Will only print "hello" one time.You could loop inside the BEGIN block and then drop out of the loop at some point. If you dropped out on friday, after the code assigning *f, it would run correctly. So: BEGIN {
sleep 86400;
*f = (localtime->wdayname eq 'Fri')
? sub() {}
: sub {};
}
f/1;#/+
Would run correctly if you started it on Thursday. |
|