[PATCH 12/48] Replace slightly too long echo staement with a here document.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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 "\033(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 "\033(K"; fi
+
+EOF
 	stat_done
     fi
 }
-- 
1.7.1



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux