#! /tools/cfr/bin/csh -f set fname = "command.log" set i = 0 set l = `awk 'END{print NR}' $fname` while ( $i <= $l ) set line="`awk '{if (NR == $i) print}' $fname`" echo "$i $line" @ i++ end