Merge pull request #217 from agxcul/master

add command [more] and some more example for command [awk]
This commit is contained in:
Chris Lane 2015-06-18 18:18:56 -04:00
commit 9db66dbaeb
2 changed files with 9 additions and 0 deletions

View file

@ -1,2 +1,8 @@
# sum integers from a file or stdin, one integer per line:
printf '1\n2\n3\n' | awk '{ sum += $1} END {print sum}'
# using specific character as separator to sum integers from a file or stdin
printf '1:2:3' | awk -F ":" '{print $1+$2+$3}'
# print a multiplication table
seq 9 | sed 'H;g' | awk -v RS='' '{for(i=1;i<=NF;i++)printf("%dx%d=%d%s", i, NR, i*NR, i==NR?"\n":"\t")}'

3
cheat/cheatsheets/more Normal file
View file

@ -0,0 +1,3 @@
# To show the file start at line number 5
more +5 file