News:

SMF - Just Installed!

Main Menu

Why shell scripting ?

Started by saurabhj, July 17, 2015, 07:49:03 PM

Previous topic - Next topic

saurabhj

In my previous post's I have mentioned What is Shell script, Different types of Shell's and How to write Shell script in linux. In this post I would like to mention about the importance of Shell scripts.

Shell scripts can take input from a user or file and produces output to the screen.
   
Whenever you find yourself doing the same task over and over again you should use shell scripting, i.e. Repetitive task automation.  Shell scripting is useful for 
Quote
       [1]  Creating your own power tools/utilities.
       [2]  Automating command input or entry.
       [3]  Customizing administrative tasks.
       [4]  Creating simple applications.
       [5]  Since scripts are well tested, the chances of errors are reduced while configuring services or system administration tasks such as adding new users.

Advantages       
Quote
       [1]  Easy to use.
       [2]  Quick start, and interactive debugging.
       [3]  Time Saving.
       [4]  System Admin task automation.
Shell scripts can execute without any additional effort on nearly any modern UNIX / Linux / BSD / Mac OS X operating system as they are written an interpreted language.

Disadvantages       
Quote
       [1]  Compatibility problems between different platforms.
       [2]  Slow execution speed.
       [3]  A new process launched for almost every shell command executed.

Practical examples where shell scripting actively used       
Quote
       [1]  Monitoring your Linux system.
       [2]  Data backup and creating snapshots.
       [3]  Creating email based alert system.
       [4]  Find out what processes are eating up your system resources.
       [5]  Find out available and free memory.
       [6]  Find out all logged in users and what they are doing.
       [7]  Find out if all necessary network services are running or not. For example if web server failed then send an alert to system administrator via a pager or an email.
       [8]  Find out all failed login attempt, if login attempt are continue repeatedly from same network IP automatically block all those IPs accessing your network/service via firewall.
       [9]  User administration as per your own security policies.
     [10]  Find out information about local or remote servers.
     [11]  Configure server such as BIND (DNS server) to add zone entries.