LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 09-28-2004, 06:54 PM   #1
Registered: Apr 2003
Posts: 225

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

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

for(i=0; i<=NR; i++)  print x[i]
it's not working!
Old 09-28-2004, 07:02 PM   #2
Registered: Aug 2002
Posts: 13,135

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


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 09:46 AM
Problem with simple shell script for loop abefroman Programming 2 10-25-2005 08:26 PM
Simple for loop lappen Programming 10 09-26-2004 06:36 AM
Simple while loop problem (newbie question) Seventh Programming 3 09-07-2004 12:00 PM
awk - simple 'for' loop doing my nut... davee Programming 2 06-30-2004 08:54 AM

All times are GMT -5. The time now is 09:03 AM.

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