[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH 1/8] call sed only once
From:       Bernhard Reutner-Fischer <rep.dot.nop () gmail ! com>
Date:       2009-10-26 22:27:02
Message-ID: 1256596029-511-2-git-send-email-rep.dot.nop () gmail ! com
[Download RAW message or body]

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
 applets/usage_compressed |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/applets/usage_compressed b/applets/usage_compressed
index 00c5735..cd09361 100755
--- a/applets/usage_compressed
+++ b/applets/usage_compressed
@@ -7,6 +7,7 @@ test "$target" || exit 1
 test "$loc" || loc=.
 test -x "$loc/usage" || exit 1
 test "$SED" || SED=sed
+test "$DD" || DD=dd
 
 sz=`"$loc/usage" | wc -c` || exit 1
 
@@ -20,15 +21,15 @@ echo 'static const char packed_usage[] ALIGN1 = {'
 ##
 ## "$loc/usage" | bzip2 -1 | od -v -x \
 ## | $SED -e 's/^[^ ]*//' \
-## | $SED -e 's/ //g' \
-## | grep -v '^$' \
-## | $SED -e 's/\(..\)\(..\)/0x\2,0x\1,/g'
+## 	-e 's/ //g' \
+## 	-e '/^$/d' \
+## 	-e 's/\(..\)\(..\)/0x\2,0x\1,/g'
 
-"$loc/usage" | bzip2 -1 | dd bs=2 skip=1 | od -v -t x1 \
+"$loc/usage" | bzip2 -1 | $DD bs=2 skip=1 | od -v -t x1 \
 | $SED -e 's/^[^ ]*//' \
-| $SED -e 's/ //g' \
-| grep -v '^$' \
-| $SED -e 's/\(..\)/0x\1,/g'
+	-e 's/ //g' \
+	-e '/^$/d' \
+	-e 's/\(..\)/0x\1,/g'
 
 echo '};'
 echo '#define SIZEOF_usage_messages' `expr 0 + $sz`
-- 
1.6.3.3

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic