Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 66407 Details for
Bug 103153
l-awk1.xml patch fixing few lacking code listings
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
l-awk1.xml.patch
l-awk1.xml.patch (text/plain), 2.46 KB, created by
Łukasz Damentko (RETIRED)
on 2005-08-20 09:29:24 UTC
(
hide
)
Description:
l-awk1.xml.patch
Filename:
MIME Type:
Creator:
Łukasz Damentko (RETIRED)
Created:
2005-08-20 09:29:24 UTC
Size:
2.46 KB
patch
obsolete
>--- l-awk1.xml-old 2005-08-20 17:55:32.000000000 +0200 >+++ l-awk1.xml 2005-08-20 18:08:37.000000000 +0200 >@@ -51,13 +51,15 @@ > </p> > > <p> >-Sure, awk doesn't have a great name. But it is a great language. Awk is geared >-toward text processing and report generation, yet features many well-designed >-features that allow for serious programming. And, unlike some languages, awk's >-syntax is familiar, and borrows some of the best parts of languages like C, >-python, and bash (although, technically, awk was created before both python and >-bash). Awk is one of those languages that, once learned, will become a key part >-of your strategic coding arsenal. >+Sure, awk doesn't have a great name. But it is a great language. Awk stands for >+"Aho, Weinberger, Kernighan" - three of the most famed computer scientists, and >+the creators of the language. Awk is geared toward text processing and report >+generation, yet features many well-designed features that allow for serious >+programming. And, unlike some languages, awk's syntax is familiar, and borrows >+some of the best parts of languages like C, python, and bash (although, >+technically, awk was created before both python and bash). Awk is one of those >+languages that, once learned, will become a key part of your strategic coding >+arsenal. > </p> > > </body> >@@ -66,6 +68,10 @@ > <title>The first awk</title> > <body> > >+<pre caption="First awk"> >+$ <i>awk '{ print }' /etc/passwd</i> >+</pre> >+ > <p> > You should see the contents of your <path>/etc/passwd</path> file appear before > your eyes. Now, for an explanation of what awk did. When we called awk, we >@@ -139,6 +145,10 @@ > { print $1 } > </pre> > >+<pre caption="Executing the sample script"> >+$ <i>awk -f script.awk /etc/passwd</i> >+</pre> >+ > <p> > The difference between these two methods has to do with how we set the field > separator. In this script, the field separator is specified within the code >@@ -204,7 +214,11 @@ > <title>Conditional statements</title> > <body> > >-<pre caption="if"> >+<pre caption="Extracting the root record with regexp"> >+$5 ~ /root/ { print $3 } >+</pre> >+ >+<pre caption="Extracting the root record with if statement"> > { > if ( $5 ~ /root/ ) { > print $3 >@@ -269,6 +283,12 @@ > <title>Numeric variables!</title> > <body> > >+<pre caption="Numeric variables!"> >+BEGIN { x = 0 } >+/^$/ { x = x + 1 } >+END { print x } >+</pre> >+ > <p> > In the BEGIN block, we initialize our integer variable x to zero. Then, each > time awk encounters a blank line, awk will execute the x=x+1 statement,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 103153
: 66407