[readonly/geninitrd/BUSYBOX: 21/113] change all 'cut' into 'awk'

draenog draenog at pld-linux.org
Sat Nov 2 19:11:48 CET 2013


commit f97d6d7bc6593cf6b1f2b18399e5ceeb93903cf0
Author: inglod <inglod at pld-linux.org>
Date:   Tue Jan 9 11:14:26 2001 +0000

    change all 'cut' into 'awk'
    
    
    svn-id: @1173

 geninitrd | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/geninitrd b/geninitrd
index f46f6cf..bd8d75e 100755
--- a/geninitrd
+++ b/geninitrd
@@ -61,9 +61,9 @@ usage () {
 findmodule() {
     skiperrors=""
     modName=$1
-    if [ "$(echo $modName | cut -b1)" = "-" ]; then
+    if [ "$(echo $modName | awk '{print(substr($0,1,1));}')" = "-" ]; then
 	skiperrors=1
-	modName="$(echo $modName | cut -b2-)"
+	modName="$(echo $modName | awk '{print(substr($0,2));}')"
     fi
 
     if [ "$modName" = "pluto" ]; then
@@ -299,12 +299,12 @@ if is_yes "$PROBERAID" ; then
 fi
 
 # check to see if we need to set up a loopback filesystem
-if is_yes "`echo "$rootdev" | cut -d/ -f3 | awk '/loop/ { print "yes"; }'`" ; then
+if is_yes "`echo "$rootdev" | awk -F/ '{print($3);}' | awk '/loop/ { print "yes"; }'`" ; then
     if [ ! -x /sbin/losetup ]; then
 	echo "losetup is missing"
 	exit 1
     fi
-    key="^# $(echo $rootdev | cut -d/ -f3 | tr '[a-z]' '[A-Z]'):"
+    key="^# $(echo $rootdev | awk -F/ '{print($3);}' | tr '[a-z]' '[A-Z]'):"
     if ! is_yes "`awk '/'$key'/ { print( "yes"); }' $fstab`" ; then
 	echo "The root filesystem is on a $rootdev, but there is no magic entry in $fstab" 1>&2
 	echo "for this device. Consult the geninitrd man page for more information" 2>&2
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/readonly/geninitrd.git/commitdiff/0999a53e93eedcf489380684b998ce04aaddf11c



More information about the pld-cvs-commit mailing list