代码搜索:awk
找到约 3,459 项符合「awk」的源代码
代码结果 3,459
www.eeworm.com/read/434450/7865930
awk hgram.awk
# histogram
# input: numbers between 0 and 99
# output: histogram for the deciles
# AKW p70
{
x[int($1/10)]++
}
END {
for (i = 0; i < 10; i++)
printf(" %2d - %2d: %
www.eeworm.com/read/434450/7865933
awk line.awk
# This program provides line numbering
# AKW p 6
{
print NR, $0
}
www.eeworm.com/read/434450/7865937
awk rantest.awk
# count the number of random numbers in ten bins
BEGIN {
srand()
for (i = 0; i < 20; i++) {
for (j = 0; j < 100000; j++)
x[int(10 * rand())]++
printf(".");
www.eeworm.com/read/434450/7865940
awk gcd.awk
# calculate the Greatest common divisor of each pair of inputs
{
arg1 =$1; arg2 = $2;
while (arg1 != arg2) {
if (arg1 > arg2)
arg1 -= arg
www.eeworm.com/read/434450/7865944
awk valid.awk
# validate input
NF != 2 { print "line", NR, "wrong number of fields"; print }
www.eeworm.com/read/434450/7865952
awk asia.awk
# compute the total population and number of Asian countries
# AKW p38
$4 == "Asia" { pop = pop + $3; n = n + 1 }
END { print "Total population of the", n,
"Asian cou
www.eeworm.com/read/434450/7865956
awk compat.awk
# compat - check if awk program uses new built-in names
# AKW p80
BEGIN { asplit("close system atan2 sin cos rand srand " \
"match sub gsub", fcns)
asplit("ARGC ARGV FNR R
www.eeworm.com/read/434450/7865960
awk mlr.awk
# delimit multiple line records and print the number of fields in each
BEGIN { RS = "" }
{ print NF, length($0), "----------------";print $0 }
END { print NR }
www.eeworm.com/read/434450/7865962
awk solve.awk
/^#/ {
print
next
}
NF > 0 {
if (start == "")
start = $1
end = $1
$1 = ""
l[end] = $0
}
END {
h[start] = start
q[1] = start
n = 1
m