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

baggins baggins at pld-linux.org
Fri Apr 27 16:02:13 CEST 2007


Author: baggins
Date: Fri Apr 27 16:02:12 2007
New Revision: 8481

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


Modified: rc-scripts/trunk/rc.d/rc.modules
==============================================================================
--- rc-scripts/trunk/rc.d/rc.modules	(original)
+++ rc-scripts/trunk/rc.d/rc.modules	Fri Apr 27 16:02:12 2007
@@ -8,8 +8,15 @@
 
 . /etc/rc.d/init.d/functions
 
-kernel=$(awk '{split($3,v,".");OFS=".";print(v[1],v[2]);}' /proc/version)
-kerneleq=$(awk '{split($3,v,".");OFS=".";print(v[1],v[2],v[3]);}' /proc/version)
+{
+	read _x _y v _z
+	old_IFS=$IFS
+	IFS='.'
+	set -- $v
+	IFS=$old_IFS
+	kernel="$1.$2"
+	kerneleq="$1.$2.$3"
+} </proc/version
 
 # Loop over every line in /etc/modules.
 ( \


More information about the pld-cvs-commit mailing list