The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 10-28-2008
royalibrahim royalibrahim is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 86
Quote:
Originally Posted by danmero View Post
awk evaluates the 1 as true and the prints the entire line by default, including a newline.
Code:
echo 'foo' | awk '/foo/{print}1'
Take a look here: The GNU Awk User's Guide: Table of Contents
But, what does 1 serve here or what is the role/purpose of 1?
Anyway, the default action of awk is to print the record right, even if the 'print' statement is missing?

Last edited by royalibrahim; 10-28-2008 at 05:34 AM..