FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux General Discussion

 
 
LinkBack Thread Tools
 
Old 06-30-2010, 09:47 PM
Victor Lowther
 
Default Replace slightly too long echo staement with a here document.

This adds a line, but making things more readable is worth it.
---
functions | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/functions b/functions
index 56c6a7b..9730150 100644
--- a/functions
+++ b/functions
@@ -265,12 +265,13 @@ set_consolefont() {
/usr/bin/setfont ${CONSOLEMAP:+-m ${CONSOLEMAP}}
$CONSOLEFONT -C ${i} >/dev/null 2>&1
done
- if [ $? -ne 0 ]; then
+ if (($? != 0)); then
stat_fail
- else
- if [ -n "$CONSOLEMAP" ]; then
- echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "33(K"; fi' >>/etc/profile.d/locale.sh
- fi
+ elif [[ $CONSOLEMAP ]]; then
+ cat <<"EOF" >>/etc/profile.d/locale.sh
+if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "33(K"; fi
+
+EOF
stat_done
fi
}
--
1.7.1
 

Thread Tools




All times are GMT. The time now is 10:51 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org