Home » Troubleshooting a Shell Script

Troubleshooting a Shell Script

by Online Tutorials Library

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.

Syntax:

Example:

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.

You may also like