diff --git a/files/scripts/sonic-netns-exec b/files/scripts/sonic-netns-exec index 166a2c7e4a2f..a0dfc6f9ab07 100755 --- a/files/scripts/sonic-netns-exec +++ b/files/scripts/sonic-netns-exec @@ -5,8 +5,8 @@ # sonic-netns-exec NS="$1" shift -if [ "$NS" != "" ]; then - ip netns exec $NS $@ +if [ ! -z "$NS" ]; then + ip netns exec $NS "$@" else - $@ + "$@" fi