Introduction
Announcements

Schedule
Labs
Assignments
TA office hours

Tests, exam

Topic videos
Some course notes
Extra problems
Lecture recordings

Discussion board

Grades so far

2.

Write a 'while' loop in sh to output the numbers from 1 to 10, by starting with '1' and adding one to it each time around the loop to get the next number. (E.g. don't use seq.)

Solution:

x=1
while test $x -le 10
do
    echo $x
    x=`expr $x + 1`
done


[sample midterm from Fall 2012]