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 -->
  #4 (permalink)  
Old 08-30-2007
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,535
Quote:
Originally Posted by nvuradi View Post
hi i am getting the following error when i used the awk command

awk 'BEGIN{FS=OFS="|"}{$NF=$NF+0} 1' $filename
Error:
awk: syntax error near line 1
awk: bailing out near line 1


if possible can you explain what is this awk command doing here?

Thanks
Narendar
change "1" to {print} .
read the man page for the definition of NF. I am bad at explaining, maybe someone is kind enough to help out.