SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network
    baggins 
    baggins at pld-linux.org
       
    Mon Apr 16 19:26:54 CEST 2007
    
    
  
Author: baggins
Date: Mon Apr 16 19:26:54 2007
New Revision: 8460
Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- use shell construct instead of grep in calcnetmask
Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==============================================================================
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network	(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.network	Mon Apr 16 19:26:54 2007
@@ -381,16 +381,14 @@
 	echo $prefix
 }
 
-#
-# folowing function calculates network mask from given prefix
+# calculate network mask from given prefix
 # (c) 1999 Grzegorz Stanislawski <stangrze at open.net.pl>
-#
 calcnetmask()
 {
 	typeset prefix a MASK
 
 	MASK=""
-	if [ "`echo "${1}" | grep "^[0-9]"`" = "" ]; then
+	if [ -n "${1##[0-9]*}" ]; then
 		prefix=32
 	else
 		typeset -i prefix=$1
    
    
More information about the pld-cvs-commit
mailing list