From 51d9f59d21888dd032061a695245e309358e9fca Mon Sep 17 00:00:00 2001 From: Leonardo Fagundes Luz Serrano Date: Fri, 16 Feb 2024 18:53:35 -0300 Subject: [PATCH] Changed str comparisons which mixed bash and posix Executing "source import-stx" produces error message: "import-stx:175: = not found" Found that a few string comparisons in the file were using the bash exclusive string comparison operator '==' within the 'test' command, which is represented by the single brackets [1]. Basically, string comparisons in single brackets need to use '='. The proposed syntax is already used in other places in the code, so this is better for consistency as well. [1] https://www.man7.org/linux/man-pages/man1/test.1.html Test Plan: pass - source import-stx Change-Id: I4d6bbbaeb9431b6e640de228d123103dd74e0de5 Signed-off-by: Leonardo Fagundes Luz Serrano --- import-stx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/import-stx b/import-stx index 684b34e4..d625bf71 100644 --- a/import-stx +++ b/import-stx @@ -172,7 +172,7 @@ if [ "$STX_PLATFORM" = "minikube" ]; then fi FSTYPE=$(stat -f -L -c %T $MINIKUBE_HOME) - if [ x"$FSTYPE" == x"nfs" ]; then + if [ x"$FSTYPE" = x"nfs" ]; then echo "" echo "Warning: stx minikube doesn't allow \$MINIKUBE_HOME or \$HOME directory as nfs mount point!!!" echo " Please set non-nfs MINIKUBE_HOME with the command 'export MINIKUBE_HOME=XXX/YYY'" @@ -189,7 +189,7 @@ if [ "$STX_PLATFORM" = "minikube" ]; then NUM_USERS=$(sqrt $(number_of_users)) ABSOLUTE_MAX_CPUS=$(($(number_of_cpus)/$NUM_USERS)) MAX_CPUS=$(number_of_cpus) - if [ "$MAX_CPUS" == "" ] || [ "$MAX_CPUS" == "0" ]; then + if [ "$MAX_CPUS" = "" ] || [ "$MAX_CPUS" = "0" ]; then MAX_CPUS=1 fi @@ -205,7 +205,7 @@ if [ "$STX_PLATFORM" = "minikube" ]; then fi MAX_MEMORY=`expr $(cat /proc/meminfo |grep MemTotal | awk '{print $2}') / 1024` - if [ "$MAX_MEMORY" == "" ] || [ "$MAX_MEMORY" == "0" ]; then + if [ "$MAX_MEMORY" = "" ] || [ "$MAX_MEMORY" = "0" ]; then MAX_MEMORY=2048 fi