Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Its not clear to me as a neophyte what this command does. Could you help by explaining it Commented Jan 2, 2019 at 16:58
  • The command PS4='Line ${LINENO}: ' bash -x XYZ goes line by line through the script XYZ and prints each line with line number. The command includes subscripts and you don’t have to modify the script (like set -X). This is useful if you want to debug scripts. Commented Jan 2, 2019 at 19:43
  • The '-x' or xtrace option tells Bash to print each command it runs as it runs it. The value of the PS4 environment variable is expanded and displayed at the beginning of each line, and $LINENO is set to the number of whatever line it's executing in the script. Commented Sep 3, 2020 at 23:55