# taken from man awk examples # emulated wc with awk { chars += length($0) + 1 # add one for the \n words += NF } END{ print(NR, words, chars) }#NR words:= words characters= chars) }