blob: 3e7ea63093d4427d379f0cad74513295b7e7ee53 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#!/bin/bash
function wrap()
{
MAXLEN=72
LEN=0
read WORDS
for WORD in ${WORDS}; do
CURLEN=`echo ${WORD} | wc -c`
if [ $((LEN + CURLEN)) -le ${MAXLEN} ]; then
LEN=$((LEN + CURLEN))
echo -n "${WORD} "
else
LEN=${CURLEN}
echo -ne "\n${WORD} "
fi
done
echo
}
echo "Le service des rumeurs est actuellement en dégrangement, laissez olmehani faire son travail, et soyez certains que dès que ça remarchera, vous en serez les premiers informés." | wrap
|