summaryrefslogtreecommitdiff
path: root/rushs/tinyprintf/80cols/80cols.sh
blob: d66cf9b3c07a3e016ce59634db188e2cc10ccbc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh

[ $# -ne 1 ] && exit 1
[ -f $1 ] || exit 1

while IFS='' read -r line; do
    var=$(printf '%s' "$line" | wc -m)
    [ "$var" -ge 80 ] && printf '%s\n' "$line"
done < "$1"

exit 0