From 8b0940895b723a1eeba097fecb11eb42d33ddd22 Mon Sep 17 00:00:00 2001 From: onceupon Date: Wed, 10 May 2017 19:22:41 +0800 Subject: [PATCH] edit awk print line number and number of characters on each line --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f07d487..89a95be 100644 --- a/README.md +++ b/README.md @@ -340,10 +340,10 @@ a=bbo;b=obb; awk -v a="$a" -v b="$b" "$1==a && $10=b' filename ``` -##### print number of characters on each line +##### print line number and number of characters on each line ```bash -awk '{print length ($0);}' filename +awk '{print NR,length($0);}' filename ``` ##### find number of columns