I saw a client doing $bash -x command to see if the file is executable (or ksh -x command, etc.) like the -x in the if st
$bash -x
ksh -x
-x
if
bash -x runs the script with tracing of each command executed
bash -x
test -x tests whether has execute permissions for the current user.
test -x
It appears that you have muddled these two.