Why shell scripting?
1) Shell script can take input from user or file and output them on screen
2) Whenever you find yourself doing same task again and again you should use scripting i.e. repetitive task automation
3) Time saving
4) Creating your own power tools/utilities
5) Customizing administrative task
6) Since scripts are well tested, chances of errors reduced while configuring services or system administration task such as adding new users
7) Practical examples where shell scripting actively used:
o Monitoring Linux system
o Data backup and creating snapshots
o Dumping Oracle or MySQL database for backup
o Creating email based alert system
o Find out process which eats up more system resources
o Find out available and free memory
o Find out all logged in users and what they are doing
o Find out if all necessary network services are running or not. For example if web server failed send an alert to system administrator via a pager or an email
o Find out all failed login attempt, if login attempt are continue repeatedly from same network IP automatically block all those IPs accessing our network/service via firewall
o Find out process which eats up more system resources
o User administration as per your own security policies
o Find out information of local or remote servers
o Configure server such as BIND (DNS server) to add zone entries
Shell scripting is fun, I enjoy it because not every handy little functionality available in built into command or program library. It is useful to create nice (perhaps ugly) things in shell scripting. Here are few script example I use everyday:
* Find out todays weather (useful when you are busy in chat room)
* Find out what’s that site running (just like netcraft)
* Download RSS feed and display them as long as you login or email them
* Find out name of MP3 file you are playing (useful when you are busy in chat room)
* Monitor your domain expiry day
Tags: Advantages of shell scripting, Scripting shell, shell scripting