Unix and Shell Programming
command. The set, map and abbr commands. Simple examples using these commands. The
shells interpretive cycle. Wild cards and file name generation. Removing the special meanings of
wild cards. Three standard files and redirection. Connecting commands: Pipe. Splitting the
output: tee. Command substitution. Basic and Extended regular expressions. The grep, egrep.
Typical examples involving different regular expressions.
Module – 4
Teaching Hours: 10 Hours
Shell programming. Ordinary and environment variables. The .profile. Read and readonly
commands. Command line arguments. exit and exit status of a command. Logical operators for
conditional execution. The test command and its shortcut. The if, while, for and case control
statements. The set and shift commands and handling positional parameters. The here ( << )
document and trap command. Simple shell program examples. File inodes and the inode
structure. File links – hard and soft links. Filters. Head and tail commands. Cut and paste
commands. The sort command and its usage with different options. The umask and default file
permissions. Two special files /dev/null and /dev/tty.
Teaching Hours: 10 Hours
Meaning of a process. Mechanism of process creation. Parent and child process. The ps
command with its options. Executing a command at a specified point of time: at command.
Executing a command periodically: cron command and the crontab file.. Signals. The nice and
nohup commands. Background processes. The bg and fg command. The kill command. The find
command with illustrative example. Structure of a perl script. Running a perl script. Variables
and operators. String handling functions. Default variables - $_ and $. – representing the current
line and current line number. The range operator. Chop() and chomp() functions. Lists and
arrays. The @- variable. The splice operator, push(), pop(), split() and join(). File handles and
handling file – using open(), close() and die () functions.. Associative arrays – keys and value
functions. Overview of decision making loop control structures – the foreach. Regular
expressions – simple and multiple search patterns. The match and substitute operators. Defining
and using subroutines.
After studying this course, students will be able to:
Explain multi user OS UNIX and its basic features
Interpret UNIX Commands, Shell basics, and shell environments
Design and develop shell programming, communication, System calls and terminology.
Design and develop UNIX File I/O and UNIX Processes.
Understand UNIX process control, relationships, commands and utilities
1. Behrouz A. Forouzan, Richard F. Gilberg : UNIX and Shell Programming- Cengage Learning – India
Edition. (Chapters- 1,2, 3, 4, 5, 7,8, 13, 14) 2009.
2. Sumitabha Das: UNIX – Concepts and Applications,4th Edition, Tata McGraw Hill.
1. Richard Blum , Christine Bresnahan : Linux Command Line and Shell Scripting Bible, 2ndEdition ,
2. M.G. Venkateshmurthy: UNIX & Shell Programming, Pearson Education.
3. W. Richard Stevens, Stephen A Rago: Advanced Programming in the UNIX Environment, 2nd Edition,
Pearson Education.(Chapters 3,7.1 to 7.9, 8, 9.1 to 9.8) .2009
Dept of CSE,SJBIT