The UNIX and Linux Forums  

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




Thread: Foreach loop
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 11-16-2007
user_prady user_prady is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 163
Quote:
Originally Posted by haze21 View Post
What am I doing wrong with this foreach loop?

foreach var ($argv)
@sum = $sum + $var
Please Dont post a new post unless until it is a new item , I think you posted this problem earlier, It will be easy if you will send it in the same link ..

Otherwise nobody is going to understand what is this
Code:
foreach var ($argv)
         @sum = $sum + $var[/QUOTE]
its a csh script or ksh script or sh script you are trying .. SO please see your last thread regarding this for your answer..

Need help on C-shell script program..

Last edited by user_prady; 11-16-2007 at 12:53 AM..