GsDevKit / GsDevKit_home

master GsDevKit project
http://gsdevkit.github.io/GsDevKit_home
MIT License
31 stars 36 forks source link

xargs has recently started misbehaving in newEtext script on several of my 20.04 machines ... replace xargs with awk #328

Closed dalehenrich closed 1 year ago

dalehenrich commented 1 year ago

This patch has worked for me:

rogue:_home>git diff
diff --git a/bin/newExtent b/bin/newExtent
index 4490b161..d5ea2cdd 100755
--- a/bin/newExtent
+++ b/bin/newExtent
@@ -132,10 +132,10 @@ extractFiletypeFromSnapshot () {
     "$GEMSTONE/bin/copydbf" -i "${ssFile}" >> $tempFile 2>&1
     trap - ERR
     trap 'error ${LINENO}' ERR
-    filetype=`cat $tempFile | sed -n '/File type:/p' | cut -d : -f 2 | xargs | cut -d \  -f 1`
+    filetype=`cat $tempFile | sed -n '/File type:/p' | cut -d : -f 2 | awk '{print $1;}'`
     if [ "${filetype}x" = "x" ] ; then
       # possibly 2.x copydbf
-      filetype=`cat $tempFile | sed -n '/file type:/p' | cut -d : -f 2 | xargs | cut -d \  -f 1`
+      filetype=`cat $tempFile | sed -n '/File type:/p' | cut -d : -f 2 | awk '{print $1;}'`
     fi
   fi
 }
dalehenrich commented 1 year ago

using awk is working ... need to run through entire test suite locally before merging (in process)

dalehenrich commented 1 year ago

fixed with PR #329