Linux and Shell Programming
Linux and Shell Programming
BY
R.GOVARTHINI
CONTENT
• INTRODUCTION TO LINUX
• OPERATING SYSTEM IN LINUX
• LINUX DISTRIBUTIONS
• VI EDITORS
• LINUX OVERVIEW
• FEATURES OF LINUX
• COMPARISON OF SHELL
• DIFFERENCE BETWEEN COMPILER AND INTERPRETER
• PROCESS
• LOGICAL OPERATORS
• INTERACTIVE SHELL SCRIPTING
• SHIFT OPERATOR
• WC COMMAND
• FILE HANDLING
• DEBUGGING
• AUTOMATING DECISION
INTRODUCTION TO LINUX
• Multiuser Capacity
• Multitasking
• Security
• File System
• Application Support
•
VI EDITOR
• 1. Indirect Declaration
• In this method, you assign a value to a specific index of
the array variable. There’s no need to declare the array
beforehand.
• ARRAYNAME[INDEXNR]=value
ARRAYS IN SHELL SCRIPT
• 2.Explicit Declaration
• With explicit declaration, you first declare the array and
then assign values to it.
• declare -a ARRAYNAME
• 3. Compound Assignment
• This method involves declaring the array along with its
initial set of values. You can later add additional values to
the array.
LOGICAL OPERATOR
• logical operators are used to test multiple conditions and
determine the outcome of the script based on those
conditions. Logical operators can be used to create
complex conditional statements that allow for more
dynamic and flexible scripts. These operators include
AND, and OR
WC COMMAND
• wc stands for word count. As the name implies, it is
mainly used for counting purpose. It is used to find out
number of lines, word count, byte and characters count in
the files specified in the file arguments. By default it
displays four-columnar output
BASIC COMMANDS IN LINUX
• Linux Directory Commands
• 1. pwd Command
• Syntax:
• pwd
BASIC COMMANDS
• The Linux command is a utility of the Linux operating
system. All basic and advanced tasks can be done by
executing commands. The commands are executed on
the Linux terminal. The terminal is a command-line
interface to interact with the system, which is similar to
the command prompt in the Windows OS. Commands in
Linux are case-sensitive.
SET COMMAND
• Linux set command is used to set and unset certain flags
or settings within the shell environment. These flags and
settings determine the behavior of a defined script and
help in executing the tasks without facing any issue. The
values of shell attributes and parameters can be changed
or displayed by using the set command.
GREP COMMAND
• The 'grep' command stands for "global regular expression
print". grep command filters the content of a file which
makes our search easy.
• Syntax:
• Syntax: