For example, I have a simple bash file
#!/bin/bash
cd ~/hello
ls
How can I make it display every command before executing it? Just the opposite effect of "@echo off" in windows batch scripting.
|
feedback
|
or
in the script | |||
feedback
|
|
These also work:
or
But -v doesn't print the PS4 string before each script line and it doesn't trace the steps of a "for" statement (for example) individually. It does echo comments while -x doesn't. Here's an example of the output using -v:
Here's the result of the same script with -x:
Note that I included "echo -n" to add emphasis to the differences between -v and -x. Also, -v is the same as "-o verbose", but the latter seems not to work as part of a shebang. | |||
feedback
|
|
goes like
language = python, perl, bash -x = operator script = filename hope it helps. | |||
|
feedback
|
|
There are a few ways.
as the shebang line. Including If I remember correctly perl also has the -x option. | |||
|
feedback
|