SlideShare a Scribd company logo
UNIX OPERATING SYSTEM

        Unix operating systems are widely used in servers, workstations, and mobile devices. The
Unix environment and the client–server program model were essential elements in the
development of the Internet and the reshaping of computing as centered in networks rather than
in individual computers.
        Unix systems are characterized by various concepts: the use of plain text for storing data;
a hierarchical file system; treating devices and certain types of inter-process
communication (IPC) as files; and the use of a large number of software tools, small programs
that can be strung together through a command line interpreter using pipes, as opposed to using a
single monolithic program that includes all of the same functionality. These concepts are
collectively known as the Unix philosophy.
       The microkernel concept was introduced in an effort to reverse the trend towards larger
kernels and return to a system in which most tasks were completed by smaller utilities. In an era
when a "normal" computer consisted of a hard disk for storage and a data terminal for input and
output (I/O), the Unix file model worked quite well as most I/O was "linear". However, modern
systems include networking and other new devices. As graphical user interfaces developed, the
file model proved inadequate to the task of handling asynchronous events such as those
generated by a mouse, and in the 1980s non-blocking I/O and the set of inter-process
communication mechanisms was augmented (sockets, shared memory, queues, semaphores), and
functionalities such as network protocols were moved out of the kernel.
       A Unix kernel — the core or key components of the operating system — consists of
many kernel subsystems like process management, memory management, file management,
device management and network management.
Each of the subsystems has some features:

       Concurrency: As Unix is a multiprocessing OS, many processes run concurrently to
       improve the performance of the system.
       Virtual memory (VM): Memory management subsystem implements the virtual memory
       concept and a user need not worry about the executable program size and the RAM size.
       Paging: It is a technique to minimize the internal as well as the external fragmentation in
       the physical memory.
       Virtual file system (VFS): A VFS is a file system used to help the user to hide the
       different file systems complexities. A user can use the same standard file system related
       calls to access different file systems.
The kernel provides these and other basic services: interrupt and trap handling, separation
between user and system space, system calls, scheduling, timer and clock handling, file
descriptor management.
Unix Architecture:

Here is a basic block diagram of a UNIX system:




The main concept that unites all versions of UNIX is the following four basics:

       Kernel: The kernel is the heart of the operating system. It interacts with hardware and
       most of the tasks like memory management, tash scheduling and file management.
       Shell: The shell is the utility that processes your requests. When you type in a command
       at your terminal, the shell interprets the command and calls the program that you want.
       The shell uses standard syntax for all commands. C Shell, Bourne Shell and Korn Shell
       are most famous shells which are available with most of the Unix variants.
       Commands and Utilities: There are various command and utilities which you would use
       in your day to day activities. cp, mv, cat and grep etc. are few examples of commands
       and utilities. There are over 250 standard commands plus numerous others provided
       through 3rd party software. All the commands come along with various optional options.
       Files and Directories: All data in UNIX is organized into files. All files are organized into
       directories. These directories are organized into a tree-like structure called the filesystem.
System Bootup:

If you have a computer which has UNIX operating system installed on it, then you simply need
to turn on its power to make it live.

As soon as you turn on the power, system starts booting up and finally it prompts you to log into
the system, which is an activity to log into the system and use it for your day to day activities.

Login Unix:

When you first connect to a UNIX system, you usually see a prompt such as the following:

To log in:

   1. Have your userid (user identification) and password ready. Contact your system
      administrator if you don't have these yet.
   2. Type your userid at the login prompt, then press ENTER. Your userid is case-sensitive,
      so be sure you type it exactly as your system administrator instructed.
   3. Type your password at the password prompt, then press ENTER. Your password is also
      case-sensitive.
   4. If you provided correct userid and password then you would be allowed to enter into the
      system. Read the information and messages that come up on the screen something as
      below.

SHELL SCRIPT

       A shell script is a script written for the shell, or command line interpreter, of an operating
system. It is often considered a simple domain-specific programming language. Typical
operations performed by shell scripts include file manipulation, program execution, and printing
text

Programming

Many modern shells also supply various features usually found only in more sophisticated
general-purpose programming languages, such as control-flow constructs, variables, comments,
arrays, subroutines, and so on. With these sorts of features available, it is possible to write
reasonably sophisticated applications as shell scripts. However, they are still limited by the fact
that most shell languages have little or no support for data typing systems, classes, threading,
complex math, and other common full language features, and are also generally much slower
than compiled code or interpreted languages written with speed as a performance goal.
Advantages and disadvantages

Often, writing a shell script is much quicker than writing the equivalent code in other
programming languages. The many advantages include easy program or file selection, quick
start, and interactive debugging. A shell script can be used to provide a sequencing and decision-
making linkage around existing programs, and for moderately-sized scripts the absence of a
compilation step is an advantage. Interpretive running makes it easy to write debugging code into
a script and re-run it to detect and fix bugs. Non-expert users can use scripting to tailor the
behavior of programs, and shell scripting provides some limited scope for multiprocessing.

Command line arguments to scripts

When you start a script from your interactive login shell, you can provide arguments to that
script on the command line. These are automatically turned into variables that can be used inside
the script.

If the command line contains filename wildcard characters, variable substitution references, or
command substitution references, those are expanded or substituted first. Then the command line
string is broken into separate arguments at blanks, except that a quoted string can contain
embedded blanks.

You refer to these arguments as separate variables within the script itself by using the dollar sign
(variable substitution operator) followed by an integer number, for example,
    cp $1 $2

This statement inside a shell script would run the cp program with the first "argument" to the
shell script (first word on the command line that started the shell script) passed as the name of
the file to copy via $1, and the second argument to the shell script passed as the name of the new
copy via $2.

The entire list of command line arguments can be referenced as one string with the syntax
  $*

Making and setting your own variables in a script

In addition to the command line arguments, the shell maintains a table of other user-created or
special purpose variables in memory. Each variable has a name and a value.

     Names - up to 20 letters or digits (start with letter) - case matters!
     Values are strings of characters or digits of arbitrary length without any intrinsic "type".
     They are treated as character strings or numeric values, depending upon how they are
     used.

It is also possible to treat any variable as an array of words and access each word separately (see
detailed documentation on the C-shell).
Certain variable names are reserved by the shell for special uses, such as path or term.

You can create any number of variables.

Using variables in the script

"Variable substitution" is the process of replacing a reference to the name of a variable with its
actual value. This is how we use variables.

The dollar sign ($) is the basic substitution operator when it is used as the prefix for a variable
name. Anytime you use the dollar sign as the first letter of a word in a shell command, it will
expect the word to be the name of a variable. If you want the dollar sign to be interpreted as just
a simple dollar sign, precede it wth the backslash () "escape" character. Here are the basic
formats for variable substitution:

   $?name
This tests whether the name variable exists. If the variable does exist, the shell substitutes the
value 1 (one, true); if not, the value 0 (zero, false). Use this form if you are just using the variable
as a flag. The result can be used in an if statement to conditionally execute some commands.

   $name
This form causes the entire word list value of name to be substituted for the reference. If name is
not defined (was never set), you get an error.

   $#name
This substitutes the number of words contained within the name variable. If the variable has a
null value (that is, simply set as a "flag" variable), it substitutes zero. If the variable has never
been set, you get an error.

   $name[n]
This substitutes the "nth" word (blank separated value) from the name variable. The square
brackets are required to enclose the value n that specifies which word is wanted, and must follow
the variable name with no intervening spaces. This is a way to treat a variable containing a multi-
word value as an array of separate words. If you specify a word index value n that is greater than
the actual number of words in the variable, you get an error.

Examples:

   set a = ($b)
Sets new variable a equal to the word list in existing variable b.

  echo $b
Echoes (prints) the value of existing variable b to the standard output (terminal).

Flow-of-control statments
if and foreach are the basic flow-of-control statements. There are more advanced ones named
switch and while which are similar to the statements of the same name in the C language.

if

The if command allows you to conditionally execute a command or set of commands depending
upon whether some expression is true. There are two forms.

     if ( logical_expression ) command ...

     This form will execute command (which can have a long list of arguments) if the
     logical__expression is true. This expression can be one of the logical or file testing
     expressions described above. For example, you can test if a file whose name is stored in
     the shell's built-in variable $1 (first argument to the shell script) exists as a plain file, and
     if so, make a backup copy of it with:

       if ( -f $1 ) cp $1 $1.bak

     This simple cp command will not work if given a directory to copy, which is why there
     is the test for a "plain" file.

     if ( logical_expression ) then

       block of commands - any number of lines
       to be executed if logical_expression is "true"
       (or has non-zero value).

     else

       another block of commands - any number of lines
       to be executed if logical_expression is "false"
       (or has value 0).

     endif

     This form allows you to execute more than one command if the expression is true. The
     then keyword must follow the logical_expression test on the same line, and the endif
     keyword must be on a line by itself to end the entire if command. The else statement is
     optional. If you use this, the else keyword must be on a line by itself. The following
     lines up to the endif are executed if the expression was false. The "blocks of
     commands" may in turn contain additional nested if commands. Just be sure that each if
     has a matching endif statement enclosed in the same block.



Relational operators
-eq: equal to

-ne: not equal to

-ge: greater than or equal to

-le: less than or equal to

-gt: greater than

-lt: less than



Logical operators

!: not

-a: and

-o: or

More Related Content

PPTX
Unix Operating System
PPTX
Introduction 2 linux
PPT
How ubuntu works???
PPT
Intro to linux
PDF
Kernel Module Programming
PDF
History of linux
ODP
Historia De Linux
PPT
Introduction and history of linux
Unix Operating System
Introduction 2 linux
How ubuntu works???
Intro to linux
Kernel Module Programming
History of linux
Historia De Linux
Introduction and history of linux

What's hot (20)

PPTX
Introduction to Linux basic
PPTX
Generation of computer
PDF
Architecture Of The Linux Kernel
PDF
Linux OS presentation
PPT
Chapter 21 - The Linux System
PPTX
Linux Operating System
PDF
Evolucion de linux
PPTX
Unix ppt
PPTX
What is Kernel, basic idea of kernel
PPT
Linux
PPTX
Operating system
PPTX
Unix
PPTX
Kali Linux Installation - VMware
PDF
Unix vs Linux | Difference Between Unix & Linux | Edureka
PPT
Linux os and its features
PPT
Unix - Sistema Operacional
PPTX
UNIX Operating System
PPTX
Unix operating system architecture with file structure
PPTX
Introduction to linux ppt
Introduction to Linux basic
Generation of computer
Architecture Of The Linux Kernel
Linux OS presentation
Chapter 21 - The Linux System
Linux Operating System
Evolucion de linux
Unix ppt
What is Kernel, basic idea of kernel
Linux
Operating system
Unix
Kali Linux Installation - VMware
Unix vs Linux | Difference Between Unix & Linux | Edureka
Linux os and its features
Unix - Sistema Operacional
UNIX Operating System
Unix operating system architecture with file structure
Introduction to linux ppt
Ad

Viewers also liked (20)

PPTX
Unix operating system
PPTX
Unix slideshare
PPTX
Unix operating system basics
PPT
Unix Internals OS Architecture
PPT
Basic Unix
PPT
IO Management
DOCX
Introduction to unix
PPT
Unix memory management
DOC
Introduction to unix
PPT
Unix ch03-03(2)
DOCX
Linux notes
PDF
Brainspotting presentation 2013_slideshare
PPTX
WELCOME TO THE CORE OF UNIX OPERATING SYSTEM
PDF
unix interprocess communication
PPTX
Unix Operating System
PDF
Estructura básica general del sistema unix
PPT
PPTX
Operating system; Multitasking
PDF
It recruitments
Unix operating system
Unix slideshare
Unix operating system basics
Unix Internals OS Architecture
Basic Unix
IO Management
Introduction to unix
Unix memory management
Introduction to unix
Unix ch03-03(2)
Linux notes
Brainspotting presentation 2013_slideshare
WELCOME TO THE CORE OF UNIX OPERATING SYSTEM
unix interprocess communication
Unix Operating System
Estructura básica general del sistema unix
Operating system; Multitasking
It recruitments
Ad

Similar to Unix operating system (20)

DOC
84640411 study-of-unix-os
PDF
M.c.a. (sem ii) operating systems
PPTX
Chapter 2 Introduction to Unix Concepts
PPT
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
PPT
LinuxOS-1 (1).ppt
PDF
UNIX_Module 1.pdf
PDF
1_Introduction_To_Unix_and_Basic_Unix_Commands
PPT
Spsl unit1
DOCX
UNIT II-Programming in Linux
PPTX
465330485-Unix-basic-commands-opera.pptx
PPTX
Unix-basic-commands-operatingSystem.pptx
PDF
DOC_LM_Chap 1 and 2. document -1 unix.pdf
PPSX
Unix environment [autosaved]
PDF
Linux For Beginners! Ultimate guide to Linux Users!!
PPT
Module1-UNIX architecture; FEATURES OF UNIX OS
PPTX
UNIX_module1.pptx
DOCX
Architecture-of-Linux-operating-system.docx
PDF
Linux for beginners
PDF
Introduction to Shell Scripting: All About It
84640411 study-of-unix-os
M.c.a. (sem ii) operating systems
Chapter 2 Introduction to Unix Concepts
Introduction to Unix operating system Chapter 1-PPT Mrs.Sowmya Jyothi
LinuxOS-1 (1).ppt
UNIX_Module 1.pdf
1_Introduction_To_Unix_and_Basic_Unix_Commands
Spsl unit1
UNIT II-Programming in Linux
465330485-Unix-basic-commands-opera.pptx
Unix-basic-commands-operatingSystem.pptx
DOC_LM_Chap 1 and 2. document -1 unix.pdf
Unix environment [autosaved]
Linux For Beginners! Ultimate guide to Linux Users!!
Module1-UNIX architecture; FEATURES OF UNIX OS
UNIX_module1.pptx
Architecture-of-Linux-operating-system.docx
Linux for beginners
Introduction to Shell Scripting: All About It

Recently uploaded (20)

PDF
KodekX | Application Modernization Development
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Big Data Technologies - Introduction.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Electronic commerce courselecture one. Pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Encapsulation_ Review paper, used for researhc scholars
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Approach and Philosophy of On baking technology
PPTX
Programs and apps: productivity, graphics, security and other tools
KodekX | Application Modernization Development
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Machine learning based COVID-19 study performance prediction
Building Integrated photovoltaic BIPV_UPV.pdf
Empathic Computing: Creating Shared Understanding
Chapter 3 Spatial Domain Image Processing.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Big Data Technologies - Introduction.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Electronic commerce courselecture one. Pdf
Spectroscopy.pptx food analysis technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Encapsulation_ Review paper, used for researhc scholars
“AI and Expert System Decision Support & Business Intelligence Systems”
Approach and Philosophy of On baking technology
Programs and apps: productivity, graphics, security and other tools

Unix operating system

  • 1. UNIX OPERATING SYSTEM Unix operating systems are widely used in servers, workstations, and mobile devices. The Unix environment and the client–server program model were essential elements in the development of the Internet and the reshaping of computing as centered in networks rather than in individual computers. Unix systems are characterized by various concepts: the use of plain text for storing data; a hierarchical file system; treating devices and certain types of inter-process communication (IPC) as files; and the use of a large number of software tools, small programs that can be strung together through a command line interpreter using pipes, as opposed to using a single monolithic program that includes all of the same functionality. These concepts are collectively known as the Unix philosophy. The microkernel concept was introduced in an effort to reverse the trend towards larger kernels and return to a system in which most tasks were completed by smaller utilities. In an era when a "normal" computer consisted of a hard disk for storage and a data terminal for input and output (I/O), the Unix file model worked quite well as most I/O was "linear". However, modern systems include networking and other new devices. As graphical user interfaces developed, the file model proved inadequate to the task of handling asynchronous events such as those generated by a mouse, and in the 1980s non-blocking I/O and the set of inter-process communication mechanisms was augmented (sockets, shared memory, queues, semaphores), and functionalities such as network protocols were moved out of the kernel. A Unix kernel — the core or key components of the operating system — consists of many kernel subsystems like process management, memory management, file management, device management and network management. Each of the subsystems has some features: Concurrency: As Unix is a multiprocessing OS, many processes run concurrently to improve the performance of the system. Virtual memory (VM): Memory management subsystem implements the virtual memory concept and a user need not worry about the executable program size and the RAM size. Paging: It is a technique to minimize the internal as well as the external fragmentation in the physical memory. Virtual file system (VFS): A VFS is a file system used to help the user to hide the different file systems complexities. A user can use the same standard file system related calls to access different file systems. The kernel provides these and other basic services: interrupt and trap handling, separation between user and system space, system calls, scheduling, timer and clock handling, file descriptor management.
  • 2. Unix Architecture: Here is a basic block diagram of a UNIX system: The main concept that unites all versions of UNIX is the following four basics: Kernel: The kernel is the heart of the operating system. It interacts with hardware and most of the tasks like memory management, tash scheduling and file management. Shell: The shell is the utility that processes your requests. When you type in a command at your terminal, the shell interprets the command and calls the program that you want. The shell uses standard syntax for all commands. C Shell, Bourne Shell and Korn Shell are most famous shells which are available with most of the Unix variants. Commands and Utilities: There are various command and utilities which you would use in your day to day activities. cp, mv, cat and grep etc. are few examples of commands and utilities. There are over 250 standard commands plus numerous others provided through 3rd party software. All the commands come along with various optional options. Files and Directories: All data in UNIX is organized into files. All files are organized into directories. These directories are organized into a tree-like structure called the filesystem.
  • 3. System Bootup: If you have a computer which has UNIX operating system installed on it, then you simply need to turn on its power to make it live. As soon as you turn on the power, system starts booting up and finally it prompts you to log into the system, which is an activity to log into the system and use it for your day to day activities. Login Unix: When you first connect to a UNIX system, you usually see a prompt such as the following: To log in: 1. Have your userid (user identification) and password ready. Contact your system administrator if you don't have these yet. 2. Type your userid at the login prompt, then press ENTER. Your userid is case-sensitive, so be sure you type it exactly as your system administrator instructed. 3. Type your password at the password prompt, then press ENTER. Your password is also case-sensitive. 4. If you provided correct userid and password then you would be allowed to enter into the system. Read the information and messages that come up on the screen something as below. SHELL SCRIPT A shell script is a script written for the shell, or command line interpreter, of an operating system. It is often considered a simple domain-specific programming language. Typical operations performed by shell scripts include file manipulation, program execution, and printing text Programming Many modern shells also supply various features usually found only in more sophisticated general-purpose programming languages, such as control-flow constructs, variables, comments, arrays, subroutines, and so on. With these sorts of features available, it is possible to write reasonably sophisticated applications as shell scripts. However, they are still limited by the fact that most shell languages have little or no support for data typing systems, classes, threading, complex math, and other common full language features, and are also generally much slower than compiled code or interpreted languages written with speed as a performance goal.
  • 4. Advantages and disadvantages Often, writing a shell script is much quicker than writing the equivalent code in other programming languages. The many advantages include easy program or file selection, quick start, and interactive debugging. A shell script can be used to provide a sequencing and decision- making linkage around existing programs, and for moderately-sized scripts the absence of a compilation step is an advantage. Interpretive running makes it easy to write debugging code into a script and re-run it to detect and fix bugs. Non-expert users can use scripting to tailor the behavior of programs, and shell scripting provides some limited scope for multiprocessing. Command line arguments to scripts When you start a script from your interactive login shell, you can provide arguments to that script on the command line. These are automatically turned into variables that can be used inside the script. If the command line contains filename wildcard characters, variable substitution references, or command substitution references, those are expanded or substituted first. Then the command line string is broken into separate arguments at blanks, except that a quoted string can contain embedded blanks. You refer to these arguments as separate variables within the script itself by using the dollar sign (variable substitution operator) followed by an integer number, for example, cp $1 $2 This statement inside a shell script would run the cp program with the first "argument" to the shell script (first word on the command line that started the shell script) passed as the name of the file to copy via $1, and the second argument to the shell script passed as the name of the new copy via $2. The entire list of command line arguments can be referenced as one string with the syntax $* Making and setting your own variables in a script In addition to the command line arguments, the shell maintains a table of other user-created or special purpose variables in memory. Each variable has a name and a value. Names - up to 20 letters or digits (start with letter) - case matters! Values are strings of characters or digits of arbitrary length without any intrinsic "type". They are treated as character strings or numeric values, depending upon how they are used. It is also possible to treat any variable as an array of words and access each word separately (see detailed documentation on the C-shell).
  • 5. Certain variable names are reserved by the shell for special uses, such as path or term. You can create any number of variables. Using variables in the script "Variable substitution" is the process of replacing a reference to the name of a variable with its actual value. This is how we use variables. The dollar sign ($) is the basic substitution operator when it is used as the prefix for a variable name. Anytime you use the dollar sign as the first letter of a word in a shell command, it will expect the word to be the name of a variable. If you want the dollar sign to be interpreted as just a simple dollar sign, precede it wth the backslash () "escape" character. Here are the basic formats for variable substitution: $?name This tests whether the name variable exists. If the variable does exist, the shell substitutes the value 1 (one, true); if not, the value 0 (zero, false). Use this form if you are just using the variable as a flag. The result can be used in an if statement to conditionally execute some commands. $name This form causes the entire word list value of name to be substituted for the reference. If name is not defined (was never set), you get an error. $#name This substitutes the number of words contained within the name variable. If the variable has a null value (that is, simply set as a "flag" variable), it substitutes zero. If the variable has never been set, you get an error. $name[n] This substitutes the "nth" word (blank separated value) from the name variable. The square brackets are required to enclose the value n that specifies which word is wanted, and must follow the variable name with no intervening spaces. This is a way to treat a variable containing a multi- word value as an array of separate words. If you specify a word index value n that is greater than the actual number of words in the variable, you get an error. Examples: set a = ($b) Sets new variable a equal to the word list in existing variable b. echo $b Echoes (prints) the value of existing variable b to the standard output (terminal). Flow-of-control statments
  • 6. if and foreach are the basic flow-of-control statements. There are more advanced ones named switch and while which are similar to the statements of the same name in the C language. if The if command allows you to conditionally execute a command or set of commands depending upon whether some expression is true. There are two forms. if ( logical_expression ) command ... This form will execute command (which can have a long list of arguments) if the logical__expression is true. This expression can be one of the logical or file testing expressions described above. For example, you can test if a file whose name is stored in the shell's built-in variable $1 (first argument to the shell script) exists as a plain file, and if so, make a backup copy of it with: if ( -f $1 ) cp $1 $1.bak This simple cp command will not work if given a directory to copy, which is why there is the test for a "plain" file. if ( logical_expression ) then block of commands - any number of lines to be executed if logical_expression is "true" (or has non-zero value). else another block of commands - any number of lines to be executed if logical_expression is "false" (or has value 0). endif This form allows you to execute more than one command if the expression is true. The then keyword must follow the logical_expression test on the same line, and the endif keyword must be on a line by itself to end the entire if command. The else statement is optional. If you use this, the else keyword must be on a line by itself. The following lines up to the endif are executed if the expression was false. The "blocks of commands" may in turn contain additional nested if commands. Just be sure that each if has a matching endif statement enclosed in the same block. Relational operators
  • 7. -eq: equal to -ne: not equal to -ge: greater than or equal to -le: less than or equal to -gt: greater than -lt: less than Logical operators !: not -a: and -o: or