SVN: rc-scripts/trunk/rc.d/rc

baggins baggins at pld-linux.org
Fri Apr 27 15:32:11 CEST 2007


Author: baggins
Date: Fri Apr 27 15:32:10 2007
New Revision: 8480

Modified:
   rc-scripts/trunk/rc.d/rc
Log:
- replace awk usage with shell constructs


Modified: rc-scripts/trunk/rc.d/rc
==============================================================================
--- rc-scripts/trunk/rc.d/rc	(original)
+++ rc-scripts/trunk/rc.d/rc	Fri Apr 27 15:32:10 2007
@@ -149,8 +149,14 @@
 text="$(termput op)$(nls '%sResource Manager: %sEntering runlevel number' "$af2" "$af7")"
 text_size="$(nls '%sResource Manager: %sEntering runlevel number' "" "")"
 resp_size="$(nls 'DONE')"
-echo -n "$text"
-awk "BEGIN { for (j=length(\"$text_size\"); j<$INIT_COL+${#resp_size}-${#runlevel}; j++) printf \".\" }"
+{
+	typeset _len=${#text_size}
+	typeset -i _last_col=$(($INIT_COL+${#resp_size}-${#runlevel}))
+	while [ $((_len++)) -lt $_last_col ]; do
+		text="$text."
+	done
+	echo -n "$text"
+}
 echo "${af6}[${af2} $runlevel ${af6}]${af7}"
 
 # Is there an rc directory for this new runlevel?
@@ -250,8 +256,14 @@
 # Say something ;)
 text="$(nls '%sResource Manager: %sRunlevel has been reached' "$af2" "$af7")"
 text_size="$(nls '%sResource Manager: %sRunlevel has been reached' "" "")"
-echo -n "$text"
-awk "BEGIN { for (j=length(\"$text_size\"); j<$INIT_COL+${#resp_size}-${#runlevel}; j++) printf \".\" }"
+{
+	typeset -i _len=${#text_size}
+	typeset -i _last_col=$(($INIT_COL+${#resp_size}-${#runlevel}))
+	while [ $((_len++)) -lt $_last_col ]; do
+		text="$text."
+	done
+	echo -n "$text"
+}
 echo "${af6}[${af2} $runlevel ${af6}]${af7}"
 unset af2 af6 af7
 


More information about the pld-cvs-commit mailing list