add things resources from the last 5 years over machines

This commit is contained in:
writer 2024-10-15 09:57:53 +09:00
parent ac9c955e0b
commit 3efc19e1f2
77 changed files with 2327 additions and 84 deletions

30
awk/math2.awk Normal file
View file

@ -0,0 +1,30 @@
# awk -f math2
BEGIN {
myprompt = "(To Stop press CTRL+D) > "
printf "Welcome to MyAddtion calculation awk program v0.1\n"
printf "%s" ,myprompt
}
{
no1 = $1
op = $2
no2 = $3
ans = 0
if ( op == "+" )
{
ans = $1 + $3
printf "%d %c %d = %d\n" ,no1,op,no2,ans
printf "%s" ,myprompt
}
else
{
printf "Opps!Error I only know how to add.\nSyntax: number1 + number2\n"
printf "%s" ,myprompt
}
}
END {
printf "\nGoodbye, %s\n !" , ENVIRON["USER"]
}