#!/bin/ksh #Change the text representation of a GIF from color to #black and white. Compute the average of the red, green, #and blue components of each pixel. awk ' NR <= 3 {print $0} NR > 3 {a = int(($1 + $2 + $3) / 3); print a, a, a} ' exit 0