Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2007-12-24 13:25:31 +0000
committershtrom <shtrom@1991c358-8f32-0410-a49a-990740bdf4c2>2007-12-24 13:25:31 +0000
commit6667c96620fcb37a781deac2ce8872c3aeab4614 (patch)
tree2dbebb2f95070c62146eeffd0f26635c1cc86b6a /wrap.sh
parenta01e82ad5013941609f09d9622ca7647feff7540 (diff)
[scripts] Added some abandonned scripts.
git-svn-id: svn+ssh://scm.narf.ssji.net/svn/shtrom/scripts@92 1991c358-8f32-0410-a49a-990740bdf4c2
Diffstat (limited to 'wrap.sh')
-rwxr-xr-xwrap.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/wrap.sh b/wrap.sh
new file mode 100755
index 0000000..3e7ea63
--- /dev/null
+++ b/wrap.sh
@@ -0,0 +1,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