Could you explain what 'x' means in the shebang #!/bin/sh -x ?
Does it necessary to put '-x' in this line?
01 Answer
What x mean in the shebang #!/bin/sh -x?
It allows you to debug the shell script:
Bash provides extensive debugging features. The most common is to start up the subshell with the -x option, which will run the entire script in debug mode. Traces of each command plus its arguments are printed to standard output after the commands have been expanded but before they are executed.
Source Debugging Bash scripts