installCDE: don't hardcode path to whoami
authorNina Didenko <nina.didenko@gmail.com>
Wed, 20 Nov 2019 19:50:06 +0000 (22:50 +0300)
committerJon Trulson <jon@radscan.com>
Thu, 21 Nov 2019 02:08:22 +0000 (19:08 -0700)
Hi.

Patch removes hardcoded paths to echo and whoami in installation scripts.

Thanks.

cde/admin/IntegTools/dbTools/installCDE.src
cde/admin/IntegTools/dbTools/mkProd

index a00fefd13aa5f1134b72b50f8f172c8c202ab5b1..233b4a96549dd008d13fff50cce6e0bc480c7a4c 100755 (executable)
@@ -52,7 +52,7 @@ LOGFILE="installCDE.$$.log"
 
 Log()
 {
-  /bin/echo "$1" | tee -a $LOGFILE
+  echo "$1" | tee -a $LOGFILE
 }
 
 MakeTarball()
@@ -537,14 +537,7 @@ XCOMM
     PLATFORM_SCRIPT_DIR=hp
   fi
 
-  if [ "$PLATFORM" = "aix" ];
-  then
-    USER=$(/bin/whoami)
-  else
-    USER=$(/usr/bin/whoami)
-  fi
-
-  if [ "$USER" != "root" ];
+  if [ $(whoami) != "root" ];
   then
     echo ""
     echo "You should be root to run this script.  Continuing anyway."
index 44591fabee6eeb94770bae7c4ac9df477b6c23af..413a77e8709aab1e35be14ebf2327451d4e59de5 100755 (executable)
@@ -96,13 +96,6 @@ else                                                # Build system = HP
         PLATFORM=hp-ux
 fi
 
-if [ $PLATFORM = "aix" ];
-then
-        USER=`/bin/whoami`
-else
-        USER=`/usr/bin/whoami`
-fi
-
 awkit() {
        awk  '
        BEGIN {
@@ -504,7 +497,7 @@ doit()
                }
                # set permissions for non-links
                if [ "${TYPE%link}" = "$TYPE" ]; then
-                       if [ "$USER" = "root" ]; then
+                       if [ $(whoami) = "root" ]; then
                                chgrp $GROUP $DEST || 
                                        echo "ERROR: \"chgrp $GROUP $DEST\" failed" >&2
                                chown $OWNER $DEST ||