Troubleshooting a shell scripts

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

Troubleshooting a shell script

There is one more way other than script execution to run a script in a different shell. Type bash with the name of the script as parameter.


bash <fileName> 


bash exm

Linux Troubleshooting a script 1

Look at the above snapshot, it displays the exm script content with bash command.

Linux Troubleshooting a script 2

Look at the above snapshot, this is the exm script we have written.

By expanding bash command with -x, shell allows us to see commands that the shell is executing.

Linux Troubleshooting a script 3

Look at the above snapshot, with command bash -x, we can see the shell expansion.