Bash tips - a small update to debugging bash scripts
Written by anil on June 26th, 2007 in Bash Scripting, Linux.
Here is a small update to, Bash tips - Debugging bash scripts We can also use other set parameters. set -f (Disable file name generation using metacharacters)
#set -f
#ls * /bin/ls: *: No such file or directory
Understand what happened? No more expansions.Wildcard is turned of. if "-f" is set bash will look for exact filenames. "*" is also considered as filename.
To turn it off use "+f"
#set +f
set -v (More verbrose) and"set +v"to turn off.
root@server4 [~]# ls tecpages .bash_profile —> Note this line
/bin/ls: tecpages: No such file or directory
.bash_profile
You can use set -xv when debugging to get a more verbrose output. Wondering what is "-x" for, please read Bash tips - Debugging bash scripts Thanks