#!/bin/tcsh
# Demonstration of a While control structure.
# This routine sums the numbers between 1 and n,
# with n being the first argument on the command line.
#
set limit = $argv[1]
set index = 1
set sum = 0
#
while ($index <= $limit)
	@ sum += $index
	@ index++
end
#
echo "The sum is $sum"
