Saturday, 28 September 2013

Mastring Unix Shell Sripiting


Mastring Unix Shell Sripiting
In Unix there are many ways to accomplish a given task. Given a problem to solve, we may be able to get to a solution in any number of ways. Of course, some will be more efficient, be more readable, use less disk space or memory, may or may not give the user feedback on what is going on or give more accurate details and more precision to the result. In this book we are going to step through every detail of writing a shell script to solve real-world Unix problems and tasks. The shell scripts range from using a pseudo- random  number generator to create pseudo-random passwords to checking for full filesystems on Unix machines and to sending pop-up messages to Windows desktops. The details required to write these shell scripts include using good style and providing good comments throughout the shell script by describing each step. Other details include combining many commands into just one command statement when desirable, separat- ing commands on 

several lines when readability and understanding of the concept may be diminished, and making a script readable and easy to maintain. We will see the bene- fit  of using variables and files to store data, show methods to strip out unwanted or unneeded data from a command output, and format the data for a particular use. Addi- tionally, we are going to show how to write and include functions in our shell scripts and demonstrate the benefits of functions over a shell script written without functions.


0 comments:

Post a Comment