Displaying Shell Expansion
When a command is entered in the command line, it expands into its output which is displayed.
This is called expansion.
The command you're typing will be printed with the help of echo command on the terminal. This command will be useful when you want to check what your command is doing in the shell.
The 'set -x' command enables shell command display.
Look at the above snapshot, 'set -x' displays shell expansion in the terminal. You can see what the shell is doing with the given command. With command "echo $USER" shell expansion shows that $USER is converted to 'sssit'.
With command "echo \$USER" shell expansion shows that due to special character backslash (\) $USER is not converted to 'sssit'.
The 'set +x' command disables shell command display.
Look at the above snapshot, shell expansion is disabled and hence, output is directly printed in the terminal.