#!/bin/sh set -efu Cmd_name=${0##*/} #echo $Cmd_name; exit 1 #LIB=$HOME/bin #. $LIB/in_out_put.sh status=0 limit=$1 shift #temp_file=$(mktemp -t ${Cmd_name}.XXXXXX) temp_out=$(mktemp -t ${Cmd_name}.XXXXXX) #cat ${1:--} | tr -s ' ' '\n' > $temp_file awk \ 'BEGIN { ref_length = '"$limit"' } {for (i = 1; i <= NF; i++) if (length($i) > ref_length) print NR, $0 }' ${1:--} > $temp_out if test -s $temp_out ; then cat $temp_out status=0 else status=1 fi rm $temp_out exit $status