Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

usage of getline

Status
Not open for further replies.

epidor

MIS
Jul 10, 2003
6
FR
Is there someone to give the meaning of this :

awk'BEGIN
$1=="coucou" {getline;print;getline {for (i=NF;i>1;i--)getline;print}}'> file2
 
For every line in which the first field is "coucou" do the following:

Read the next line and print it.
Read the next line. read a number of lines equal to the number of fields in this line minus one.
Print the last line read.

CaKiwi

"I love mankind, it's people I can't stand" - Linus Van Pelt
 
yeah, that's sounds right, but.......... there's no 'execution block' definition for the 'BEGIN' clause.

The script as is will produce a syntax error when ran.

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top