From man bash
(yes, it's a big man page, usually Google search is faster):
-x
After expanding each simple command, for command, case command, select command, or arithmetic for command, display the expanded value of PS4, followed by the command and its expanded arguments or associated word list.
Effectively: when you run a script, it will show all actions done in that script. So all ifs, loops and commands run. Very useful for debugging.
-v
Print shell input lines as they are read. When a script is run, it will print the entire script as it reads the file. When you use the shell interactively, it will show each command after you press enter.
The quotes above are from the explanation of the set
builtin command in the man bash
, which also explains that the options for set
can also be passed as arguments (on the shebang line):
The options are off by default unless otherwise noted. Using +
rather than -
causes these options to be turned off. The
options can also be specified as arguments to an invocation of
the shell. The current set of options may be found in $-
. The
return status is always true unless an invalid option is encountered.