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 -->
  #1 (permalink)  
Old 01-07-2008
bikas_jena bikas_jena is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 13
Error in AWK Program

Hi Friends,
I need your help.

I am not able to execute one awk program .If you can solve the following small program
then i can solve other one.

$ vi prg

#!/bin/awk -f
BEGIN {

# Print the squares from 1 to 10 the first way

i=1;
while (i <= 10) {
printf( "The square of ", i, " is ", i*i);
i = i+1;
}

# now end
exit;
}

then i made chmod 777 prg

when i execute like
$prg
The square of The square of The square of The square of The square of The square of The square of The square of The square of The square of $

its coming like this.

Please let me know where i have done the mistake.

Thanks in advance
Bikas