aboutsummaryrefslogtreecommitdiffstats
path: root/doc/rat-cursors/to-text
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-04-10 22:10:42 +0200
committerMattias Andrée <maandree@operamail.com>2015-04-10 22:10:42 +0200
commit1929b8584a13ffb9dcaafecbcad7595c81ad9418 (patch)
treec4d1eb5f02f63a89a79a3bca673d0c8f1634142d /doc/rat-cursors/to-text
parentderp (diff)
downloadmds-1929b8584a13ffb9dcaafecbcad7595c81ad9418.tar.gz
mds-1929b8584a13ffb9dcaafecbcad7595c81ad9418.tar.bz2
mds-1929b8584a13ffb9dcaafecbcad7595c81ad9418.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'doc/rat-cursors/to-text')
-rwxr-xr-xdoc/rat-cursors/to-text11
1 files changed, 8 insertions, 3 deletions
diff --git a/doc/rat-cursors/to-text b/doc/rat-cursors/to-text
index dc7007c..998159b 100755
--- a/doc/rat-cursors/to-text
+++ b/doc/rat-cursors/to-text
@@ -1,5 +1,10 @@
-#!/bin/sh -e
+#!/bin/sh
-sed 's/\(.\) /\1\1/g' | sed 's/\./ /g' | sed 's/@/X/g' |
- sed 's/ \+$//g'
+data="$(sed 's/\(.\) /\1\1/g' | sed 's/\./ /g' | sed 's/@/X/g' | sed 's/ \+$//g')"
+
+while [ $(echo "${data}" | grep -v '^ ' | grep -v '^$' | wc -l) = 0 ]; do
+ data="$(echo "${data}" | sed 's/^ //')"
+done
+
+echo "${data}"