Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 828 Bytes

007_Executing_a_Shell_Script.md

File metadata and controls

29 lines (22 loc) · 828 Bytes

Executing a Shell Script

COMMENTS IN SHELL --- HOME --- DEBUGGING A SHELL SCRIPT

First, we need to add execution permission to our script which can be achieved using,

chmod +x SCRIPTNAME

To read more about permissions, use the command man chmod

Further, run the script using,

./SCRIPTNAME

Also, we can run the script directly, without adding execution permission to the script using,

bash SCRIPTNAME

Here, the bash interpretor is specified.

We also have another way of executing the shell script, for it we also don't require execution permission.

. SCRIPTNAME

Here we are using .(dot command), which reads and execute command from the file in current shell.