foreach (tcsh command)
Loop, expand words, and execute commands
SYNTAX
       foreach name (wordlist)
       ...
       end     
Successively set the variable name to each member of wordlist and execute the sequence of commands between this command and the matching end.(Both foreach and end must appear alone on separate lines.)
The builtin command continue may be used to continue the loop prematurely and the builtin command break to terminate it prematurely.
When this command is read from the terminal, the loop is read once prompting 
  with `foreach? ' (or prompt2) before any statements in the loop are executed. 
  If you make a mistake typing in a loop at the terminal you can rub it out.
  
  Examples
#! /bin/tcsh # loop through a set of numbers foreach myloop (1 2 3 4 5) echo -n "$myloop" end #! /bin/tcsh # loop through a set of files
foreach f (*.html)
echo $f
end #! /bin/tcsh # Rename a set of .csv file extensions to .xls
foreach f (*.csv)
mv $f `basename $f .csv`.xls
end
`foreach' is a tcsh shell command.
"The big thieves hang the little ones" - Czech Proverb
Related commands:
  
  break - Exit from a loop
  for - Expand words, and execute commands  
  repeat - Execute a command multiple times 
  while - Execute commands 
  continue - Resume the next iteration of a while or foreach loop
  
  Equivalent BASH command:
  
  while - Execute commands