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XJdjg{hR9~_f '5U+}W5%ZjzgTtozYD @%JK\qymeЪKIIp"xoz\B1$G)8Ԅ Jeyc".yyVBR-%BEA-k^Luj cYwԄ%X!e-4ZRḡlJvYsB԰˗0?RM\TlaߏVu4BmY!UyYylgd!m2$i=[hN,6)_~7͖CDF2zÕ{?l;Hܲk׋!/XAłrCXEI{]P[e! ?%Ktqܱ5! jַĞ*TvAG)fuxTҖV7~ 4=r! ob%jTwU$Bnqed䤿@0P&V]HJ)^YrޯĿbsY8=1! n}UD*7uƫi~!s[W{V9J;~Ӯ|[3s۷dڔIj?qJ'O,IkE]G(5\ۖ7)-g,ŶǗ=~e>k쐁%(g˦o[fxN_baGBm:܆VGЗ,G_D!/og,ҢVܤ_iS_~@ SkidSec Webshell

SkidSec WebShell

Server Address : 172.31.38.4

Web Server : Apache/2.4.58 (Ubuntu)

Uname : Linux ip-172-31-38-4 6.14.0-1017-aws #17~24.04.1-Ubuntu SMP Wed Nov 5 10:48:17 UTC 2025 x86_64

PHP Version : 7.4.33



Current Path : /usr/share/doc/mawk/examples/



Current File : //usr/share/doc/mawk/examples/hcal
#!/usr/bin/mawk -We
# $MawkId: hcal,v 1.6 2020/09/24 22:05:19 tom Exp $
# vile:ts=4 sw=4

# edit the above to be the full pathname of 'mawk'
# @(#) hcal - v01.00.02 - Tue Feb 27 21:21:21 EST 1996
# @(#) prints a 3-month (highlighted) calendar centered on the target month
# @(#) may be edited for week to start with Sun or Mon & for local language
# @(#) to display a usage screen, execute: hcal -h
# NOTE: to edit, set ts=4 in 'vi' (or equivalent)
#		to print, pipe through 'pr -t -e4'

# Using ideas from a KornShell script by Mikhail Kuperblum (mikhail@klm.com)
# Bob Stockler - bob@trebor.iglou.com - Sysop CompuServe SCOForum [75162,1612]

BEGIN {
# Local Edits:
	PROG	 = "hcal"		# Program name given to this script
#	FMT 	 = 0			# date format dd/mm/yyyy
#	FMT1 	 = 0			# for weekdays ordered "Mo Tu We Th Fr Sa Su"
	FMT 	 = 1			# date format mm/dd/yyyy
	FMT1 	 = 1 			# for weekdays ordered "Su Mo Tu We Th Fr Sa"
# edit day & month names and abbreviations for local language names
	Days[0]	 = "Mo Tu We Th Fr Sa Su"
	Days[1]	 = "Su Mo Tu We Th Fr Sa"
	MONTHS	 = "January February March April May June July August"
	MONTHS	 = MONTHS " September October November December"
	Months	 = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"
#	STDOUT	 = 0			# emulate SCO Unix 'cal' (NO highlighting)
	STDOUT	 = 1			# default to highlight mode
	MINUS	 = "-"          # possible input date field delimiter
	SLASH	 = "/"          # possible input date field delimiter
	DOT 	 = "."          # possible input date field delimiter
	IDFD	 = "[" MINUS    # make MINUS the first character in this series
	IDFD	 = IDFD SLASH   #		so that it stands for itself in the RE
	IDFD	 = IDFD DOT "]" # Input Date Field Delimiters RE
	ODFD	 = SLASH		# Output Date Field Delimiter (default)
	DATE_FMT = "%.2d%s%.2d%s%.4d"	# date format
## this script presumes 'date' recognizes these arguments in these ways:
##	w - Day of the week - Sunday = 0
##	m - Month of year - 01 to 12
##	d - Day of month - 01 to 31
##	y   Last 2 digits of year - 00 to 99
##	Y - Year (including century), as decimal numbers
##	j - Day of the year - 001 to 366 (Julian date)
##	T - Time as HH:MM:SS
##	X   Current time, as defined by the locale
##	a - Abbreviated weekday - Sun to Sat
##	b - Abbreviated month name
##	Z - Timezone name, or no characters if no timezone exists
##	Command to get today's date information:
##	DATE = "/bin/date '+%w %m %d 19%y %j~%a %b %d %T %Z 19%y'"
##      For sunos4
##	DATE = DATE = "/bin/date '+%w %m %d 19%y %j~%a %h %d %T    19%y'"
	DATE = "/bin/date '+%w %m %d %Y %j~%a %b %d %X %Z %Y'"
# End of Local Edits

	INT_RE   = "^[0-9]+$"					# unsigned integer RE
	S_INT_RE = "^[-+][0-9]+$"				# signed integer RE
	MNAM_RE	 = "^[A-Za-z]+$"				# month name RE
	YEAR_RE	 = "^[0-9]?[0-9]?[0-9]?[0-9]$"
	DATE_RE  = "^[0-9]?[0-9]" IDFD "[0-9]?[0-9]" IDFD "[0-9]?[0-9]?[0-9]?[0-9]$"
	DAT1_RE  = "^[0-9]?[0-9]" IDFD "[0-9]?[0-9]$"

	split(Months,M_Name)
	split("31 28 31 30 31 30 31 31 30 31 30 31",Mdays) ; Mdays[0] = 0

	ERR = 0
	HELP = 0
	RMSO = 0
	NUM_ARGS = ARGC - 1
	if ( ARGV[1] == "-x" ) {
		# standout mode switch
		if ( STDOUT == 1 ) STDOUT = 0 ; else STDOUT = 1
		ARG1 = ARGV[2] ; ARG2 = ARGV[3] ; NUM_ARGS -= 1
	}
	else if ( ARGV[1] ~ /^-[h?]$/ ) { HELP = 1 ; exit }
	else { ARG1 = ARGV[1] ; ARG2 = ARGV[2] }

	if ( STDOUT == 1 ) {
		# get the terminal standout-start & standout-end control codes
		so = ENVIRON["so"] ; if ( ! so ) "tput smso" | getline so
		se = ENVIRON["se"] ; if ( ! se ) "tput rmso" | getline se
	}

	if ( NUM_ARGS == 0 ) {
		# no arguments - print a calendar display centered on today
		DEFAULT = 1
	}
	else if ( NUM_ARGS == 1 ) {
		# one argument - may be a month name, date, year, or interval of days
		if		( ARG1 ~ DATE_RE  ) DATE1 = Fmt_Date(ARG1)
		else if ( ARG1 ~ DAT1_RE  ) DATE1 = ARG1
		else if ( ARG1 ~ MNAM_RE  ) { Get_Mnum() ; DATE1 = RMSO = ARG1 "/1" }
		else if	( ARG1 ~ S_INT_RE ) INTERVAL = ARG1 + 0
		else if	( ARG1 ~ INT_RE   ) {
			if ( ARG1 > 0 && ARG1 <= 9999 ) YEAR = ARG1 + 0
			else if ( ARG1 > 9999 ) { ERR = 9 ; exit }
			else { ERR = 7 ; exit }
		}
		else	{ ERR = 1 ; exit }
	}
	else if ( NUM_ARGS == 2 ) {
		# two arguments, the second of which must be an integer
		if ( ARG2 ~ INT_RE ) {
			ARG2 = ARG2 + 0
			if  ( ARG2 < 1 ) { ERR = 7 ; exit }
			else if ( ARG2 > 9999 ) { ERR = 9 ; exit }
		}
		else { ERR = 1 ; exit }
		RMSO = 1
		# the first may be a string or an integer
		if ( ARG1 ~ INT_RE ) {
			# a month number and a year
			if ( ARG1 < 1 || ARG1 > 12 ) { ERR = 4 ; mm = ARG1 ; exit }
		}
		else if ( ARG1 ~ MNAM_RE ) {
			Get_Mnum()
		}
		else { ERR = 6 ; exit }
		DATE1 = ARG1 "/1/" ARG2
	}
	else { ERR = 2 ; exit }

	if		( DEFAULT  ) { Get_Now() }
	else if ( INTERVAL ) {
		Get_Now()
		daynum = daynum + ( INTERVAL % 7 )
		this_date = ""
		DATE1 = Get_Date(INTERVAL,m,d,y,j)
		split(DATE1,mdy,IDFD)
		Mon[2] = mdy[1] + 0
		today  = mdy[2] + 0
		Year[1] = Year[2] = Year[3] = mdy[3] + 0
	}
	else if ( DATE1 ) {
		Get_Now()
		if ( split(DATE1,mdy,IDFD) == 2 ) DATE1 = DATE1 "/" This_Year
		Chk_Date(DATE1)
		Mon[2] = mdy[1] + 0
		today  = mdy[2] + 0
		Year[1] = Year[2] = Year[3] = mdy[3] + 0
		DATE1 = sprintf( "%.2d/%.2d/%.4d", Mon[2], today, Year[2] )
		INTERVAL = Get_Num(DATE1,m,d,y,j)
		daynum = daynum + ( INTERVAL % 7 )
		this_date = ""
	}
	else if ( YEAR ) {
		so = se = ""
		Get_Now()
		Mon[2] = 2
		today = 1
		Year[1] = Year[2] = Year[3] = YEAR
		DATE1 = sprintf( "%.2d/%.2d/%.4d", Mon[2], today, Year[2] )
		INTERVAL = Get_Num(DATE1,m,d,y,j)
		daynum = daynum + ( INTERVAL % 7 )
		this_date = ""
	}
	else { ERR = 5 ; exit }

	if		( Mon[2] !=  1 ) Mon[1] = Mon[2] - 1
	else	{ Mon[1] = 12 ; Year[1] -= 1 }
	if		( Mon[2] != 12 ) Mon[3] = Mon[2] + 1
	else	{ Mon[3] =  1 ; Year[3] += 1 }
	if		( Mon[1] == 2 ) Leap(Year[1])
	else if	( Mon[2] == 2 ) Leap(Year[2])
	else if	( Mon[3] == 2 ) Leap(Year[3])

	Start[2] = 7 - ( ( today - daynum ) % 7 )
	Start[1] = 7 - ( ( Mdays[Mon[1]] - Start[2] ) % 7 )
	Start[3] =       ( Mdays[Mon[2]] + Start[2] ) % 7

	if ( ! YEAR ) quarters = 1
	else {
		quarters = 4 ; s[3] = Start[3]
		for (i=4;i<=12;i++) { s[i] = ( Mdays[i-1] + s[i-1] ) % 7 }
	}
	ll = 0
	for ( quarter = 1 ; quarter <= quarters ; quarter++ ) {
		if ( quarter > 1 ) {
			delete cal
			ll = 0 ;  Mon[1] += 3 ; Mon[2] += 3 ; Mon[3] += 3
			Start[1] = s[Mon[1]] ; Start[2] = s[Mon[2]] ; Start[3] = s[Mon[3]]
		}
		if ( Year[2] == 1752 && Mon[2] ~ /8|9|10/ ) Kludge_1752()
		if ( ARG1 ) print "" ; else printf( "\n%s\n\n", this_date )
		for (i=1;i<=3;i++) { while ( Start[i] >= 7 ) Start[i] -= 7 }
		for (mm=1;mm<=3;mm++) { l = 1
			if ( mm != 2 ) { So = Se = "" } else { So = so ; Se = se }
			cal[mm SUBSEP l++] = sprintf( "%s      %-4s%.4d      %s   ", \
				So, M_Name[Mon[mm]], Year[mm], Se )
			cal[mm SUBSEP l++] = sprintf( "%s%3s", Days[FMT1], "" )
			j = k = 1
			while ( j <= Mdays[Mon[mm]] ) {
	  			line = ""
	  			for (i=1;i<=7;i++) {
					if ( Start[mm] > 0 || j > Mdays[Mon[mm]] ) {
						date = "" ; Start[mm]-- }
					else date = j++
					if ( Year[mm] == 1752 && Mon[mm] == 9 && date == 3 ) {
						date = 14 ; j = 15 }
					if ( date == today && mm == 2 && ! RMSO ) {
						So = so ; Se = se }
					else { So = Se = "" }
					line = sprintf( "%s%s%2s%s ", line, So, date, Se )
	  			}
				cal[mm SUBSEP l++] = sprintf( "%s  ", line )
			}
			if ( l > ll ) ll = l
		}
		for (l=1;l<ll;l++) {
			for (mm=1;mm<=3;mm++) {
				if ( cal[mm SUBSEP l] != "" ) printf( cal[mm SUBSEP l] )
				else printf( "%23s", "" )
				if ( mm % 3 == 0 ) print ""
			}
		}
	}
	print ""
	exit 0
}
END {
	if ( ! HELP && ! ERR ) exit 0
	if ( ERR ) {
		for (i=1;i<ARGC;i++) { ARGS = ARGS sp ARGV[i] ; sp = " " }
		if		( ERR == 1 ) msg = "Bad argument format or content:"
		else if	( ERR == 2 ) msg = "Wrong argument count (" ARGC - 1 "):"
		else if ( ERR == 3 ) msg = "Date before 01/01/0001 (" Get_Y1() "):"
		else if ( ERR == 4 ) msg = "Bad month (" mm "):"
		else if ( ERR == 5 ) msg = "Bad date (" dd "):"
		else if ( ERR == 6 ) msg = "Impossible date:"
		else if ( ERR == 7 ) msg = "The was no year 0000:"
		else if ( ERR == 8 ) msg = "Non-unique month name (" ARG1 "):"
		else if ( ERR == 9 ) msg = "Year greater than 9999:"
		else				 msg = "Unknown error:"
		HELP = 1 ; q = "\""
	}
	if ( HELP ) {
	  if ( FMT == 1 )	{ fmt = "[m]m/[d]d[/yyyy]" ; range = "12/31/9999" }
	  else				{ fmt = "[d]d/[m]m[/yyyy]" ; range = "31/12/9999" }
	  if ( STDOUT == 0 ) n = " not " ; else n = " " ; sp = "    "
	  u=  "\n    Usage:  " PROG " [-x] [args]\n\n" sp
	  u=u "Prints a 3-month calendar centered on the target month.\n\n" sp
	  u=u "The default is" n "to highlight the target month (and date if\n" sp
	  u=u "appropriate);  -x switches the default highlight behavior.\n" sp
	  u=u "With no arguments the target date defaults to today.\n\n" sp
	  u=u "Arguments may be a date in " fmt " format (where\n" sp
	  u=u "leading 0's are implied in all unfilled fields, defaulting\n" sp
	  u=u "to the current year if that field is omitted); a month and\n" sp
	  u=u "year (where month may be an integer or a month name, perhaps\n" sp
	  u=u "abbreviated, but sufficient to be unique); or the month name\n" sp
	  u=u "alone (which defaults to the current year); or a year alone\n" sp
	  u=u "(which prints a 12-month calendar for that year).\n\n" sp
	  u=u "A signed integer alone as an argument specifies the target\n" sp
	  u=u "date to be -n days before or +n days after the current date.\n\n" sp
	  u=u "Dates from 01/01/0001 to " range " are supported.\n"
	  usage = u
	}
	printf( "\n%s:    %s %s%s%s\n", PROG, msg, q, ARGS, q ) >"/dev/tty"
	print usage >"/dev/tty"
	exit ERR
}

function Get_Now() {
	# get the week, month, date & year numbers and the time-of-day
	DATE | getline date
	split(date,Date,"~")
	split(Date[1],field)
	daynum = field[1] + FMT1
	m = field[2] ; This_Mon	= Mon[2] = m + 0
	d = field[3] ; This_Date = today = d + 0
	y = This_Year = Year[1] = Year[2] = Year[3] = field[4]
	j = julian = field[5] + 0
	this_date = Date[2]
}

function Fmt_Date(fmt_date) {
    # format dates as mm/dd/yyyy or dd/mm/yyyy
    split(fmt_date,MorD_DorM_Y,IDFD)
    if ( FMT == 1 )	{ Dt_Fld1 = MorD_DorM_Y[1] ; Dt_Fld2 = MorD_DorM_Y[2] }
    else			{ Dt_Fld1 = MorD_DorM_Y[2] ; Dt_Fld2 = MorD_DorM_Y[1] }
    Dt_Fld3 = MorD_DorM_Y[3]
    return sprintf( DATE_FMT, Dt_Fld1, ODFD, Dt_Fld2, ODFD, Dt_Fld3 )
}

function Kludge_1752() {
	# kludge for September 1752 & the change to the Gregorian Calendar
	Mdays[9] = 30
	if		( Mon[2] ==  9 ) {
		Start[1] = Start[2] = 1 + FMT1 ; Start[3] = -1 + FMT1
	}
	else if	( Mon[2] ==  8 ) {
		Start[1] =  2 + FMT1 ; Start[2] =  5 + FMT1 ; Start[3] =  1 + FMT1
	}
	else if	( Mon[2] == 10 ) {
		Start[1] =  1 + FMT1 ; Start[2] = -1 + FMT1 ; Start[3] =  3
	}
}

function Get_Mnum() {
			ARG1 = tolower(ARG1)
			months = tolower(MONTHS)
			split(months,month)
			for (i=1;i<=12;i++) {
				if ( index(month[i],ARG1) == 1 ) { ARG = i ; n++ }
			}
			if ( n == 1 ) ARG1 = ARG
			else if ( n == 0 ) { ERR = 1 ; exit }
			else { ERR = 8 ; exit }
}

function Get_Num(get_date,get_m,get_d,get_y,get_j) {
	# get the number of days from one date to another date
	NOW = get_y get_m get_d ; N = 0 ; M = get_m + 0 ; D = get_d + 0 ; Y = get_y + 0 ; J = get_j + 0
	split(get_date,mdy,IDFD)
	M2 = mdy[1] ; D2 = mdy[2] ; Y2 = mdy[3]
	THEN = Y2 M2 D2 ; M2 = M2 + 0 ; D2 = D2 + 0 ; Y2 = Y2 + 0
	Leap(Y2)
	if ( M2 > 12 )									{ ERR = 4 ; exit }
	if ( D2 > Mdays[M2] && Y2 != 1752 && M2 != 9 )	{ ERR = 5 ; exit }
	if ( THEN ~ /^1752090[3-9]$|^1752091[0-3]$/ )	{ ERR = 6 ; exit }
	Leap(Y)
	if ( THEN > NOW ) {
		Ydays = Ydays - J + 1 ; mdays = Mdays[M] - D + 1
		while ( Y < Y2 ) Next_Y()
		while ( M < M2 ) Next_M()
		while ( D < D2 ) Next_D()
		N *= -1
	}
	else {
		Ydays = J ; mdays = D
		while ( Y > Y2 ) Prev_Y()
		while ( M > M2 ) Prev_M()
		if ( Y == 1752 && M == 9 && D == 19 ) D = 30
		while ( D > D2 ) Prev_D()
	}
	return N
}

function Get_Date(get_n,get_m,get_d,get_y,get_j) {
	# get the date a number of days before or after a date
	N = get_n + 0 ; M = get_m + 0 ; D = get_d + 0 ; Y = get_y + 0 ; J = get_j + 0
	if ( N != 0 ) {
		Leap(Y)
		if ( N > 0 ) {
			Ydays = Ydays - J + 1 ; mdays = Mdays[M] - D + 1
			while ( N >= Ydays ) { Next_Y() ; Leap(Y) }
			while ( N >= ( ( mdays > 0 ) ? mdays : Mdays[M] ) ) { Next_M() }
			while ( N > 0 ) Next_D()
		}
		else {
			Ydays = J ; mdays = D ; N *= -1
			while ( N >= Ydays ) { Prev_Y() ; Leap(Y) }
			while ( N >= ( ( mdays > 0 ) ? mdays : Mdays[M] ) ) { Prev_M() }
			if ( Y == 1752 && M == 9 && D == 19 ) D = 30
			while ( N > 0 ) Prev_D()
		}
		if ( Y < 1 ) { ERR = 3 ; exit }
	}
	return M ODFD D ODFD Y
}

function Leap(YR) {
	# adjust for Leap Years
	if ( YR % 4 == 0 && ( YR % 100 != 0 || YR % 400 == 0 || YR < 1800 ) ) {
		Ydays = 366 ; Mdays[2] = 29 }
	else { Ydays = 365 ; Mdays[2] = 28 }
	if ( YR != 1752 ) Mdays[9] = 30
	else { Ydays = 355 ; Mdays[9] = 19 }
}

function Chk_Date(chk_date) {
	# check validity of input dates
	split(chk_date,mdy,IDFD)
	mm = mdy[1] + 0 ; dd = mdy[2] + 0 ; yy = mdy[3] + 0
	if ( mm == 2 ) Leap(yy)
	if ( yy  < 1 )						{ ERR = 3 ; exit }
	if ( mm  < 1 || mm  > 12 )			{ ERR = 4 ; exit }
	if ( dd  < 1 || dd  > Mdays[mm] )	{ ERR = 5 ; exit }
}

# day counting functions for next or previous year, month and day
function Next_Y() {
	N -= Ydays ; Y += 1 ; M = 1 ; D = 1 ; mdays = 0 ; Leap(Y)
}
function Next_M() {
	if ( mdays != 0 ) N -= mdays ; else N -= Mdays[M]
	M += 1 ; D = 1 ; mdays = 0
}
function Next_D() {
	N -= 1 ; D += 1
	if ( D > Mdays[M] ) { M += 1 ; D = 1 }
	else if ( Y == 1752 && M == 9 && D == 2 ) D = 13
}
function Prev_Y() {
	N -= Ydays ; Y -= 1 ; M = 12 ; D = 31 ; mdays = 0 ; Leap(Y)
}
function Prev_M() {
	if ( mdays != 0 ) N -= mdays ; else N -= Mdays[M]
	M -= 1 ; D = Mdays[M] ; mdays = 0
}
function Prev_D() {
	N -= 1 ; D -= 1 ; if ( Y == 1752 && M == 9 && D == 13 ) D = 2
}

function Get_J(get_m,get_d,get_y) {
	# get the Julian date for an input date
	get_m = get_m + 0 ; get_d = get_d + 0 ; get_y = get_y + 0
	Leap(get_y)
	j = get_d
	for (i=1;i<get_m;i++) j = j + Mdays[i]
	return j
}

function Get_Y1() {
	# get the number of days to day 1 for the help screen
	if ( ! m ) {
		if ( mm ) { m = mm ; d = dd ; y = yy }
		else if ( M ) { m = M ; d = D ; y = Y }
	}
	if ( ! j ) Get_J()
	return Get_Num("01/01/0001",m,d,y,j)
}