Shell Scripting (BASH)

In the simplest terms, a shell script is a file containing a series of commands. The shell reads this file and carries out the commands as though they have been entered directly on the command line.

 

Here I am scripting a shutdown command .

# vim shutdown.sh

add

#!/bin/bash
sudo shutdown -h now

:wq

#now type ls you can see the file shutdown.sh
#to run type sh shutdown.sh 


Its similar to DOS batch file .

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s