Experiment No 12 (OSII)
Experiment No 12 (OSII)
A shell script is a text file that contains a sequence of commands for a UNIX-
based operating system. It is called a shell script because it combines a sequence of
commands, that would otherwise have to be typed into the keyboard one at a time,
into a single script. The shell is the operating system's command-line interface (CLI)
and interpreter for the set of commands that are used to communicate with the
system.
A shell script is usually created for command sequences in which a user has a need to
use repeatedly in order to save time. Like other programs, the shell script can
contain parameters, comments and subcommands that the shell must follow. Users
initiate the sequence of commands in the shell script by simply entering the file
name on a command line.
In the DOS operating system, a shell script is called a batch file. In IBM's mainframe
VM operating systems, it's called an EXEC.
Shell scripts contain ASCII text and are written using a text editor, word processor or
graphical user interface (GUI). The content of the script is a series of commands in a
language that can be interpreted by the shell. Functions that shell scripts support
include loops, variables, if/then/else statements, arrays and shortcuts. Once
complete, the file is saved typically with a .txt or .sh extension and in a location that
the shell can access.
Types of shells
In Unix and Linux, the two major types of shell scripts are:
1. Bourne again shells (BASH)- BASH is the default shell for Unix version 7. The
character for prompting a bourne again shell is $.
2. C shells- A C shell is run in a text terminal window and is able to easily read file
commands. The character for prompting a C shell is %.
Completing batch
Manipulating files.
Monitoring a system.
Follow the commands and perform shell scripting and taka a screenshot of
terminal.
https://www.geeksforgeeks.org/how-to-create-a-shell-script-in-linux/
Conclusion.