Linux Shell Scripting Tutorial: A Beginner‘s handbook

来源:百度文库 编辑:神马文学网 时间:2024/04/29 18:50:42
 

Linux Shell Scripting Tutorial v1.05r3
A Beginner‘s handbook

Copyright © 1999-2002 by Vivek G. Gite


(Formally know as vivek-tech.com)


Table of Contents

Chapter 1: Quick Introduction to Linux
What Linux is?
Who developed the Linux?
How to get Linux?
How to Install Linux
Where I can use Linux?
What Kernel Is?
What is Linux Shell?
How to use Shell
What is Shell Script ?
Why to Write Shell Script ?
More on Shell...
Chapter 2: Getting started with ShellProgramming
How to write shell script
Variables in shell
How to define User defined variables (UDV)
Rules for Naming variable name (Both UDVand System Variable)
How to print or access value of UDV (Userdefined variables)
echo Command
Shell Arithmetic
More about Quotes
Exit Status
The read Statement
Wild cards (Filename Shorthand or metaCharacters)
More commands on one command line
Command Line Processing
Why Command Line arguments required
Redirection of Standard output/input i.e.Input - Output redirection
Pipes
Filter
What is Processes
Why Process required
Linux Command(s) Related with Process
Chapter 3: Shells (bash) structuredLanguage Constructs
Decision making in shell script ( i.e.if command)
test command or [ expr ]
if...else...fi
Nested ifs
Multilevel if-then-else
Loops in Shell Scripts
for loop
Nested for loop
while loop
The case Statement
How to de-bug the shell script?
Chapter 4: Advanced Shell ScriptingCommands
/dev/null - to send unwanted output ofprogram
Local and Global Shell variable (exportcommand)
Conditional execution i.e. && and||
I/O Redirection and file descriptors
Functions
User Interface and dialog utility-Part I
User Interface and dialog utility-Part II
Message Box (msgbox) using dialog utility
Confirmation Box (yesno box) using dialogutility
Input (inputbox) using dialog utility
User Interface using dialog Utility -Putting it all together
trap command
The shift Command
getopts command
Chapter 5: Essential Utilities for PowerUser
Preparing for Quick Tour of essentialutilities
Selecting portion of a file using cututility
Putting lines together using paste utility
The join utility
Translating range of characters using trutility
Data manipulation using awk utility
sed utility - Editing file without usingeditor
Removing duplicate lines from textdatabase file using uniq utility
Finding matching pattern using grep utility
Chapter 6: Learning expressions with ex
Getting started with ex
Printing text on-screen
Deleting lines
Coping lines
Searching the words
Find and Replace (Substituting regularexpression)
Replacing word with confirmation from user
Finding words
Using range of characters in regularexpressions
Using & as Special replacementcharacter
Converting lowercase character to uppercase
Chapter 7: awk Revisited
Getting Starting with awk
Predefined variables of awk
Doing arithmetic with awk
User Defined variables in awk
Use of printf statement
Use of Format Specification Code
if condition in awk
Loops in awk
Real life examples in awk
awk miscellaneous
sed - Quick Introduction
Redirecting the output of sed command
How to write sed scripts?
More examples of sed
Chapter 8: Examples of Shell Scripts
Logic Development:
Shell script to print given numbers sum ofall digit
Shell script to print contains of file fromgiven line number to next given number of lines
Shell script to say Goodmorning/Afternoon/Evening as you log in to system
Shell script to find whether entered year isLeap or not
Sort the given five number in ascendingorder (use of array)
Command line (args) handling:
Adding 2 nos. suppiled as command line args
Calculating average of given numbers oncommand line args
Finding out biggest number from given threenos suppiled as command line args
Shell script to implement getopts statement.
Basic math Calculator (case statement)
Loops using while & for loop:
Print nos. as 5,4,3,2,1 using while loop
Printing the patterns using for loop.
Arithmetic in shell scripting:
Performing real number calculation in shellscript
Converting decimal number to hexadecimalnumber
Calculating factorial of given number
File handling:
Shell script to determine whether givenfile exist or not.
Screen handling/echo command with escape sequence code:
Shell script to print "Hello World"message, in Bold, Blink effect, and in different colors like red, brownetc.
Background process implementation:
Digital clock using shell script
User interface and Functions in shell script:
Shell script to implements menu based system.
System Administration:
Getting more information about your workingenvironment through shell script
Shell script to gathered useful systeminformation such as CPU, disks, Ram and your environment etc.
Shell script to add DNS Entery to BINDDatabase with default Nameservers, Mail Servers (MX) and host
Integrating awk script with shell script:
Script to convert file names from UPPERCASEto lowercase file names or vice versa.
Chapter 9: Other Resources
Appendix - A : Linux File Server Tutorial(LFST) version b0.1 Rev. 2
Appendix - B : LinuxCommand Reference (LCR)
About the author
About this Document


Home Next
Up Quick Introduction to Linux