#!/bin/bash # toolong--Feeds the fmt command only those lines in the input stream # that are longer than the specified length. setglobal width = '72' if test ! -r $1 { echo "Cannot read file $1" > !2 echo "Usage: $0 filename" > !2; exit 1 } while read input { if test $(#input) -gt $width { echo $input | fmt } else { echo $input } } < $1 exit 0