#!/bin/sh
# toolong - N'applique la commande fmt qu'aux lignes du flux d'entre
#   qui sont plus grandes que la longueur indique

width=72

if [ ! -r "$1" ] ; then
  echo "Syntaxe: $0 nom_fichier" >&2; exit 1 
fi

while read input 
  do 
    if [ ${#input} -gt $width ] ; then
      echo "$input" | fmt 
    else  
      echo "$input" 
    fi 
  done < $1

exit 0
