diff --git a/src/runtime_src/core/tools/xbutil2/xbutil b/src/runtime_src/core/tools/xbutil2/xbutil index d4ac1bd42a..875e8c2971 100755 --- a/src/runtime_src/core/tools/xbutil2/xbutil +++ b/src/runtime_src/core/tools/xbutil2/xbutil @@ -43,7 +43,7 @@ XRT_LOADER_DIR="`dirname \"$0\"`" # For edge platforms loader is not required as tools are in standard location(/usr). # So calling unwrapped tool from this script itself. -if [[ $XRT_LOADER_DIR =~ "/usr" || $XRT_LOADER_DIR =~ "/bin" ]]; then +if [[ $XRT_LOADER_DIR =~ ^(/usr|/bin) ]]; then "${XRT_LOADER_DIR}/unwrapped/${XRT_PROG}" "${XRTWRAP_PROG_ARGS[@]}" exit 0 fi diff --git a/src/runtime_src/core/tools/xbutil2/xrt-smi b/src/runtime_src/core/tools/xbutil2/xrt-smi index 395ffc23f2..ec3626338b 100755 --- a/src/runtime_src/core/tools/xbutil2/xrt-smi +++ b/src/runtime_src/core/tools/xbutil2/xrt-smi @@ -35,7 +35,7 @@ XRT_LOADER_DIR="`dirname \"$0\"`" # For edge platforms loader is not required as tools are in standard location(/usr). # So calling unwrapped tool from this script itself. -if [[ $XRT_LOADER_DIR =~ "/usr" || $XRT_LOADER_DIR =~ "/bin" ]]; then +if [[ $XRT_LOADER_DIR =~ ^(/usr|/bin) ]]; then "${XRT_LOADER_DIR}/unwrapped/${XRT_PROG}" "${XRTWRAP_PROG_ARGS[@]}" exit 0 fi