0% found this document useful (0 votes)
2 views3 pages

Operating System Labasg2b

The document provides an introduction to shells and shell scripting, defining various shell types such as Bourne Shell, Bash, C Shell, and Korn Shell. It also describes the vi editor, its modes, and commands for saving and quitting files. Additionally, it includes a shell script example that assigns a name to a variable and displays it when executed.

Uploaded by

mdsanowarali7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Operating System Labasg2b

The document provides an introduction to shells and shell scripting, defining various shell types such as Bourne Shell, Bash, C Shell, and Korn Shell. It also describes the vi editor, its modes, and commands for saving and quitting files. Additionally, it includes a shell script example that assigns a name to a variable and displays it when executed.

Uploaded by

mdsanowarali7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Operating System Lab (PC-CS 492)

Name: Anish Das Roll No. BTech/CSE/23/077


Assignment No.: 2a
Problem Statement :
Introduction to shell and shell script
a. Define shell, shell type and vi editor

SOLUTION

Shell is an command language interpreter that executes commands


read from the standard input device (keyboard) or from a file.It is not
a part of system kernel, but uses the system kernel to execute
programs, create files etc.
Shell types
Just like people know different languages and dialects, your UNIX
system will usually offer a variety of shell types:
• sh or Bourne Shell: the original shell still used on UNIX systems and
in UNIXrelated environments. This is the basic shell, a small program
with few features. While this is not the standard shell, it is still
available on every Linux system for compatibility with UNIX
programs.
• bash or Bourne Again shell: the standard GNU shell, intuitive and
flexible. Probably most advisable for beginning users while being at
the same time a powerful tool for the advanced and professional
user. On Linux,bash is the standard shell for common users. This shell
is a so-called superset of the Bourne shell, a set of add-ons and plug-
ins. This means that the Bourne Again shell is compatible with the
Bourne shell: commands that work in sh, also work in bash. However,
the reverse is not always the case. All examples and exercises in this
book use bash.
• csh or C shell: the syntax of this shell resembles that of the C
programming language. Sometimes asked for by programmers.
• tcsh or TENEX C shell: a superset of the common C shell, enhancing
userfriendliness and speed. That is why some also call it the Turbo C
shell.
• ksh or the Korn shell: sometimes appreciated by people with a
UNIX background. A superset of the Bourne shell; with standard
configuration a nightmare for beginning users.
The file /etc/shells gives an overview of known shells on a Linux
system. Use the command: cat /etc/shells
Brief description of vi editor ➢ The vi editor s available on almost all
UNIX system and in LINUX ➢ vi (visual editor) displays window where
the file is edited. It is a text editor. Starting vi: Vi - creates new file or
open existing file
Modes:
➢ Command
➢ Insert
Closing and saving file
: ZZ- save file and quit
:w- save file
:q!- discard changes and quit file
:wq- save file and exit

Assignment No.: 2b
Problem Statement :
b. Create a shell script. Define a variable val1, assign your name into
it and show your name by running or executing this script.

Source Code:
labex:project/$ vi ass2b.sh
labex: project/$ sh ass2b.sh
ass2b.sh :
val="Anish Das"
echo $val

Output:
Anish Das

You might also like