in message <[EMAIL PROTECTED]>, wrote Murray Taylor thusly... > > # generate the sms message > # the awk code forces the message to be < 160 chars ... > tmpfile=`mktemp -t sms` > echo ${phone} >> ${tmpfile} > ${AWK} '{ printf "%-0.159s", $0 }' >> ${tmpfile} << EOF2 > `echo $msg` > EOF2
As it is, any line longer than 159 characters will just overflow. You need to use substr() not awk to shorten a line. Even after that modification, that won't solve your actual problem as the awk script will just shorten EACH line (when record separator is newline), not the whole output. There are ports which seems to do what you want to do. - Parv -- _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"