From 142d1c8a095c1b45f556850c21214ac6e4bb7971 Mon Sep 17 00:00:00 2001 From: "Ramón M. Gómez" Date: Tue, 6 Jul 2021 11:55:45 +0200 Subject: #1048: Avoid Awk 5.x warning when escaping quotes. --- client/engine/Boot.lib | 2 +- client/engine/Image.lib | 6 +++--- client/engine/Inventory.lib | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/engine/Boot.lib b/client/engine/Boot.lib index f60b9327..b5532190 100755 --- a/client/engine/Boot.lib +++ b/client/engine/Boot.lib @@ -1447,7 +1447,7 @@ function ogBootLoaderHidePartitions () # /* (comentario de bloque para Doxygen) # Entradas de Windows: numero de linea y particion. De mayor a menor. - WINENTRY=$(awk '/menuentry.*Windows/ {gsub(/\)\"/, ""); gsub(/^.*dev/,""); print NR":/dev"$1} ' $CFGFILE | sed -e '1!G;h;$!d') + WINENTRY=$(awk '/menuentry.*Windows/ {gsub(/\)["'"'"']/, ""); gsub(/^.*dev/,""); print NR":/dev"$1} ' $CFGFILE | sed -e '1!G;h;$!d') #*/ (comentario para bloque Doxygen) # Particiones de Windows, pueden no estar en el grub. WINPART=$(fdisk -l $(ogDiskToDev)|awk '/NTFS/ {print $1}'|sed '1!G;h;$!d') diff --git a/client/engine/Image.lib b/client/engine/Image.lib index a2465a12..941deb91 100755 --- a/client/engine/Image.lib +++ b/client/engine/Image.lib @@ -950,9 +950,9 @@ then if `echo $PARTCLONEINFO | grep size > /dev/null` then TOOLS=PARTCLONE - FS=$(echo $PARTCLONEINFO | awk '{gsub(/\: /,"\n"); print toupper($8);}') + FS=$(echo $PARTCLONEINFO | awk '{gsub(/: /,"\n"); print toupper($8);}') if [[ "$FS" == "HFS" || "$FS" == "HFSPLUS" || "$FS" == "FAT32" ]]; then - FSPLUS=$(echo $PARTCLONEINFO | awk '{gsub(/\: /,"\n"); print toupper($9);}') + FSPLUS=$(echo $PARTCLONEINFO | awk '{gsub(/: /,"\n"); print toupper($9);}') echo $PARTCLONEINFO | grep GB > /dev/null && SIZEFACTOR=1000000 || SIZEFACTOR=1024 if [ "$FSPLUS" == "PLUS" ]; then FS=$FS$FSPLUS @@ -962,7 +962,7 @@ then fi else echo $PARTCLONEINFO | grep GB > /dev/null && SIZEFACTOR=1000000 || SIZEFACTOR=1024 - SIZE=$(echo $PARTCLONEINFO | awk -v FACTOR=$SIZEFACTOR '{gsub(/\: /,"\n"); printf "%d\n", $11*FACTOR;}') + SIZE=$(echo $PARTCLONEINFO | awk -v FACTOR=$SIZEFACTOR '{gsub(/: /,"\n"); printf "%d\n", $11*FACTOR;}') fi IMGDETECT="TRUE" fi diff --git a/client/engine/Inventory.lib b/client/engine/Inventory.lib index a905f1bd..a7a52564 100755 --- a/client/engine/Inventory.lib +++ b/client/engine/Inventory.lib @@ -408,11 +408,11 @@ MNTDIR=$(ogMount $1 $2) || return $? # Para GNU/Linux: leer descripción. TYPE="Linux" FILE="$MNTDIR/etc/os-release" -[ -r $FILE ] && VERSION="$(awk -F= '$1~/PRETTY_NAME/ {gsub(/\"/,"",$2); print $2}' $FILE)" +[ -r $FILE ] && VERSION="$(awk -F= '$1~/PRETTY_NAME/ {gsub(/"/,"",$2); print $2}' $FILE)" # Si no se puede obtener, buscar en ficheros del sistema. if [ -z "$VERSION" ]; then FILE="$MNTDIR/etc/lsb-release" - [ -r $FILE ] && VERSION="$(awk -F= '$1~/DESCRIPTION/ {gsub(/\"/,"",$2); print $2}' $FILE)" + [ -r $FILE ] && VERSION="$(awk -F= '$1~/DESCRIPTION/ {gsub(/"/,"",$2); print $2}' $FILE)" for DISTRIB in redhat SuSE mandrake gentoo; do FILE="$MNTDIR/etc/${DISTRIB}-release" [ -r $FILE ] && VERSION="$(head -1 $FILE)" -- cgit v1.2.3-18-g5258