BSC It Assignments
BSC It Assignments
BSC It Assignments
Marks – 20
UNIX OPERATING SYSTEM
Each question carries equal marks
11. Write a note on:
a)Shell script UNIX is a multitasking, multiuser operating system. Multitasking is very
useful, and once you get used to it, you’ll use it all of the time. Before long, you’ll be
able to run programs in the “background”, switch between multiple tasks, and “pipeline”
programs together to achieve complicated results with a single command. Many of the
features we’ll be covering in this section are features provided by the shell itself. Be
careful not to confuse UNIX (the actual operating system) with the shell—the shell is just
an interface to the underlying system. The shell provides a great deal of functionality on
top of UNIX itself. The shell is not only an interpreter for your interactive commands,
which you type at the prompt. It is also a powerful programming language, which allows
you to write shell scripts, to “batch” several shell commands together in a file. MS-DOS
users will recognize the similarity to “batch files”. Use of shell scripts is a very powerful
tool, which will allow you to automate and expand your usage of UNIX.
There are several types of shells in the UNIX world. The two major types are the “Bourne shell”
and the “C shell”. The Bourne shell uses a command syntax like the original shell on early UNIX
systems, such as System III. The name of the Bourne shell on most UNIX systems is /bin/sh
(where sh stands for “shell”). The C shell (not to be confused with sea shell) uses a different
syntax, somewhat like the programming language C, and on most UNIX systems is named
/bin/csh.
b) Kernel : The Unix kernel acts as a mediator for your programs. First, it does the memory
management for all of the running programs (processes), and makes sure that they all get a fair
(or unfair, if you please) share of the processor’s cycles. In addition, it provides a nice, fairly
portable interface for programs to talk to your hardware. Obviously, there is more to the kernel’s
operation than this, but the basic functions above are the most important to know.
2. What are the different file system? How do you view the files? Explain.
Ans : The file system is the collection of files and the hierarchy of directories on your system.
Different file systems are
/bin is short for “binaries”, or executables. This is where many essential system
programsreside.
/dev The “files” in /dev are known as device drivers—they are used to access
system devicesand resources, such as disk drives, modems, memory, and so on.
BT0051 – 02
Marks – 20
UNIX OPERATING SYSTEM
Each question carries equal marks
11. Write a note on print queues.
Ans : For each printer, a spool area is defined. Data for the printer is collected in the spool
area, one file per print job. A background process (called the printer daemon) constantly
scans the spool areas for new files to print. When one appears, the data is sent to the
appropriate printer or despooled. When more than one file is waiting to be printed, they
will be printed in the order they were completed - first in, first out. Thus the spool area is
effectively a queue, and the waiting jobs are often referred to as being “in the print
queue”, or “queued”. In the case of remote printing, the data is first spooled locally as for
any other print job, but the background process is told to send the data to a particular
printer on a particular remote machine. The necessary information that the printer
daemon needs to do its job - the physical device to use, the spool area to look in, the
remote machine and printer for remote printing and so on - is all stored in a file called
/etc/printcap. The details of this file are discussed below. In the discussions that
follow, the term “printer” will be used to mean a printer as specified in
/etc/printcap. The term “physical printer” will be used to mean the thing that
actually puts characters on paper. It is possible to have multiple entries in
/etc/printcap which all describe one physical printer, but do so in different ways.