Tuesday, November 6, 2007

Catchy Phrases In 2010

Wrong awk examples

recently published the book of John Linux Plötner and Steffen Wendzel also Galileo Computing as Open Book - in my view very recommended:). In the chapter on awk have in the examples but unfortunately Backlsashes slipped at the end of the grease marks that do not belong there. The execution of these examples leads to error messages like: awk

: Command line: 9: \\}
awk: Command line: 9: ^ backslash not last character on the line.


If the question backslash is removed, the example works but again correctly - Example Listing 4.29:

$ awk 'BEGIN {
print "Here is the file content:"
}

{
print
}

END {print
"The end of file is reached."
print "Bye!"
} '/ tmp / input file


Since especially newcomers to the handling of the tool awk easily here might despair of the examples, I have the below feedback form, however, already used to set the author of the erroneous slashes in the online version thereof.

0 comments:

Post a Comment