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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

why am I not getting any output from awk?

Status
Not open for further replies.

fito

Programmer
Jun 6, 2000
1
SE
Hi,<br>&nbsp;&nbsp;I'm running a very simple awk to sum about 1.5 million rows with numbers. The command runs a couple a minutes and then i get the unix prompt back with no output.<br>Here's my script:<br>cat bal.lst¦awk '{s+=$1}end{print $s}'<br><br>where's the error?<br>Thanks.
 
The &quot;end&quot; word must be capitalized and the<br>&quot;s&quot; variable cannot have the dollar sign<br>which would make it field(some big number<br>outside the limits of AWK).<br><br>Your code should look like:<br><br>cat bal.lst ¦ awk '{s+=$1}END{print s}'<br><br><br>Hope this helps you. <p>flogrr<br><a href=mailto:flogr@yahoo.com>flogr@yahoo.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top