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
The -x option starts a BASH shell in tracing mode. You can see all the details of how your command/script is processed. It's a good way to find some bugs if your script does not do what you would expect to
And, just as Alex said in a comment, to run a command in BASH, you have to use -c option like bash -x -c ls.
See man bash or the online manual, specifically the parts on invoking Bash and the set builtin command for more information:
All of the single-character options used with the
setbuiltin (see The Set Builtin) can be used as options when the shell is invoked.
-xPrint a trace of simple commands,
forcommands,casecommands,selectcommands, and arithmeticforcommands and their arguments or associated word lists after they are expanded and before they are executed. The value of thePS4variable is expanded and the resultant value is printed before the command and its expanded arguments.