diff --git a/pages/common/awk.md b/pages/common/awk.md index fd3da07e4..a2a715d06 100644 --- a/pages/common/awk.md +++ b/pages/common/awk.md @@ -29,8 +29,8 @@ - Print all values starting from the third column: -`awk '{ s = ""; for (i=3; i <= NF; i++) s = s $i " "; print s }'` +`awk '{for (i=3; i <= NF; i++) printf $i""FS; print""}' {{filename}}` - Print different values based on conditions: -`awk '{if ($1 == "foo") print "Exact match foo"; else if ($1 ~ "bar") print "Partial match bar"; else print "Baz"}'` +`awk '{if ($1 == "foo") print "Exact match foo"; else if ($1 ~ "bar") print "Partial match bar"; else print "Baz"}' {{filename}}`