LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 09-28-2004, 07:54 PM   #1
saiz66
Member
 
Registered: Apr 2003
Posts: 225

Rep: Reputation: 30
[c shell] simple for loop


How can I write a for loop in c shell???

Code:
for(i=0; i<=NR; i++)  print x[i]
it's not working!
 
Old 09-28-2004, 08:02 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,152

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
The c shell per my shell programming book does not have for loops. Instead you can use a while loop. i.e.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell variable in Linux is reset after while loop CBenner Programming 7 05-19-2006 10:46 AM
Problem with simple shell script for loop abefroman Programming 2 10-25-2005 09:26 PM
Simple for loop lappen Programming 10 09-26-2004 07:36 AM
Simple while loop problem (newbie question) Seventh Programming 3 09-07-2004 01:00 PM
awk - simple 'for' loop doing my nut... davee Programming 2 06-30-2004 09:54 AM


All times are GMT -5. The time now is 10:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration