[arch-general] [PATCH 10/48] Replace trivial use of grep with bash regex conditional.
Victor Lowther
victor.lowther at gmail.com
Wed Jun 30 17:47:42 EDT 2010
Bash has regex support, and it allows us to replace most trivial
uses of sed, grep, and awk. The fewer processes we create, the faster
we go, and every little bit helps.
I also think it is more readable to use a bash regex for the trivial stuff.
---
functions | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/functions b/functions
index f954737..8aaee68 100644
--- a/functions
+++ b/functions
@@ -260,9 +260,7 @@ set_consolefont() {
[[ $CONSOLEFONT ]] || return 0
stat_busy "Loading Console Font: $CONSOLEFONT"
#CONSOLEMAP in UTF-8 shouldn't be used
- if [ -n "$CONSOLEMAP" ] && echo "$LOCALE" | /bin/grep -qi utf ; then
- CONSOLEMAP=""
- fi
+ [[ $CONSOLEMAP && $LOCALE =~ UTF|utf ]] && CONSOLEMAP=""
for i in /dev/tty[0-9]*; do
if [ -n "$CONSOLEMAP" ]; then
/usr/bin/setfont -m $CONSOLEMAP $CONSOLEFONT -C ${i} >/dev/null 2>&1
--
1.7.1
More information about the arch-general
mailing list