This page lists which functions are available in each version of
awk. I am building the list based on my own experience,
questions from readers, and occasional research. If you find a version of
awk, or a function, that is not listed here, or if you find an error on
these pages, write to Rob to let me know about it.
Function | awk | nawk | gawk | DOS awk | |
---|---|---|---|---|---|
cos(x) | YES | YES | YES | YES | |
exp(x) | YES | YES | YES | YES | |
int(x) | YES | YES | YES | YES | |
log(x) | YES | YES | YES | YES | |
sin(x) | YES | YES | YES | YES | |
sqrt(x) | YES | YES | YES | YES | |
index(s,t) | YES | YES | YES | YES | |
length(s) | YES | YES | YES | YES | |
split(s,a,sep) | YES | YES | YES | YES | |
sprintf("fmt",expr) | YES | YES | YES | YES | |
substr(s,p,n) | YES | YES | YES | YES | |
system(s) | no | YES | YES | YES | |
atan2(y,x) | no | YES | ? | YES | |
rand() | no | YES | ? | YES | |
srand(x) | no | YES | ? | ? | |
gsub(r,s,t) | no | YES | ? | YES | |
match(s,r) | no | YES | ? | YES | |
sub(r,s,t) | no | YES | ? | YES | |
tolower(s) | no | YES | YES | ? | In fact, in nawk, these handle international characters |
toupper(s) | no | YES | YES | ? |