You want
Code:
if [ $count -gt 10 ]; then
It would be more efficient to open four file descriptors and then just print to those descriptors; this approximates the
Perl approach I suggested above.
Code:
exec 1>rt1.txt 2>rt2.txt 3>rt3.txt 4>rt4.txt
count=1
while read line; do
case $count in
1|4|7) print "$line" >&1;;
2|5|8) print "$line" >&2;;
3|6|9) print "$line" >&3;;
10) print "$line" >&4; count=0;;
esac
count=`expr $count + 1`
done <My_Test.txt
Note the use of
print rather than
echo -- this is ksh-specific, but other than that, this script should be portable.