__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
# alarm.awk --- set an alarm
#
# Requires getlocaltime() library function
#
# Arnold Robbins, arnold@skeeve.com, Public Domain
# May 1993
# Revised December 2010
# usage: alarm time [ "message" [ count [ delay ] ] ]
BEGIN {
# Initial argument sanity checking
usage1 = "usage: alarm time ['message' [count [delay]]]"
usage2 = sprintf("\t(%s) time ::= hh:mm", ARGV[1])
if (ARGC < 2) {
print usage1 > "/dev/stderr"
print usage2 > "/dev/stderr"
exit 1
}
switch (ARGC) {
case 5:
delay = ARGV[4] + 0
# fall through
case 4:
count = ARGV[3] + 0
# fall through
case 3:
message = ARGV[2]
break
default:
if (ARGV[1] !~ /[[:digit:]]?[[:digit:]]:[[:digit:]]{2}/) {
print usage1 > "/dev/stderr"
print usage2 > "/dev/stderr"
exit 1
}
break
}
# set defaults for once we reach the desired time
if (delay == 0)
delay = 180 # 3 minutes
if (count == 0)
count = 5
if (message == "")
message = sprintf("\aIt is now %s!\a", ARGV[1])
else if (index(message, "\a") == 0)
message = "\a" message "\a"
# split up alarm time
split(ARGV[1], atime, ":")
hour = atime[1] + 0 # force numeric
minute = atime[2] + 0 # force numeric
# get current broken down time
getlocaltime(now)
# if time given is 12-hour hours and it's after that
# hour, e.g., `alarm 5:30' at 9 a.m. means 5:30 p.m.,
# then add 12 to real hour
if (hour < 12 && now["hour"] > hour)
hour += 12
# set target time in seconds since midnight
target = (hour * 60 * 60) + (minute * 60)
# get current time in seconds since midnight
current = (now["hour"] * 60 * 60) + \
(now["minute"] * 60) + now["second"]
# how long to sleep for
naptime = target - current
if (naptime <= 0) {
print "alarm: time is in the past!" > "/dev/stderr"
exit 1
}
# zzzzzz..... go away if interrupted
if (system(sprintf("sleep %d", naptime)) != 0)
exit 1
# time to notify!
command = sprintf("sleep %d", delay)
for (i = 1; i <= count; i++) {
print message
# if sleep command interrupted, go away
if (system(command) != 0)
break
}
exit 0
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| alarm.awk | File | 2.31 KB | 0644 |
|
| anagram.awk | File | 1.33 KB | 0644 |
|
| awksed.awk | File | 515 B | 0644 |
|
| cut.awk | File | 3.61 KB | 0644 |
|
| dupword.awk | File | 507 B | 0644 |
|
| egrep.awk | File | 2.4 KB | 0644 |
|
| extract.awk | File | 1.84 KB | 0644 |
|
| guide.awk | File | 165 B | 0644 |
|
| histsort.awk | File | 283 B | 0644 |
|
| id.awk | File | 4.24 KB | 0644 |
|
| igawk.sh | File | 3.11 KB | 0644 |
|
| indirectcall.awk | File | 1.91 KB | 0644 |
|
| labels.awk | File | 1014 B | 0644 |
|
| pi.awk | File | 341 B | 0644 |
|
| split.awk | File | 3.25 KB | 0644 |
|
| tee.awk | File | 770 B | 0644 |
|
| testbits.awk | File | 736 B | 0644 |
|
| translate.awk | File | 1.15 KB | 0644 |
|
| uniq.awk | File | 2.9 KB | 0644 |
|
| wc.awk | File | 1.79 KB | 0644 |
|
| wordfreq.awk | File | 347 B | 0644 |
|