diff --git a/bin/java_show_classpath.sh b/bin/java_show_classpath.sh index 50de9012144..cd4d16985d2 100755 --- a/bin/java_show_classpath.sh +++ b/bin/java_show_classpath.sh @@ -104,9 +104,9 @@ show_jinfo_classpath(){ echo "command: $(ps -f -p "$pid" | tail -n +2 | sed 's/^[[:space:]]*//')" echo else - if ! [[ "$cmd" =~ \ ]]; then + if ! [[ "$cmd" =~ [[:\<:]]java[[:\>:]] ]]; then # shellcheck disable=SC2028 - echo "skipping $cmd since it doesn't match regex \\" + echo "skipping $cmd since it doesn't match regex [[:\\<:]]java[[:\\>:]]" return fi cmd="$(replace_classpath_with_token "$cmd")"