help understanding awk
I am trying to debug a script that another person wrote. I am not very strong understanding awk. Can somebody please explain what this line is doing?
cat ${origfile} | awk '{sub("\014","\n\\page\n");print $0 "\par"}' >>${rtftempfile} I know awk is doing some kind of manipulation of the acsii file ${origfile}, just not sure what. Thanks |
The syntax of the sub function is:
Code:
sub(regexp, replacement [, target]) Code:
sub("\014","\n\\page\n") |
Google "gawk". There is book in postscript format about gawk ("gnu awk"). Awk is almost a programming language - so do not expect reasonably introduction in the two or three posts.
|
What does the "\par" represent after the record $0?
|
It is a string with those characters in it.
|
Quote:
Code:
print $0 "\\par" Code:
$ cat > file http://www.grymoire.com/Unix/Awk.html http://www.gnu.org/software/gawk/manual/ |
You guys rock!!! Thanks for all of the help!!
|
All times are GMT -5. The time now is 11:22 PM. |