From 1929b8584a13ffb9dcaafecbcad7595c81ad9418 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 10 Apr 2015 22:10:42 +0200 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- doc/rat-cursors/to-text | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'doc/rat-cursors') 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}" -- cgit v1.2.3-70-g09d2