Linux Shell Scripting and Python
Linux Shell Scripting and Python
Reference:
1. Beginning Unix – Joe Marilino (Wrox Publication)
2. Linux Command Line And Shell Scripting Bible – Blum (Wiley – India)
3. Programming and Problem solving with Python- Ashok Namdev Kamthane and Amit
Ashok Kamthane (Mc Graw Hill Education)
Session 1
Lecture: Linux Basics
Introduction to Linux
o History
o Overview
o Additional Features of Linux
Getting Started to Linux
o Basic Commands
(ls, cp, mv, sort, grep, cat,head,tail, man, locate, find, diff, file, rm, mkdir, rmdir, cd,
pwd, ln and ln –s, gzip and gunzip, zip and unzip, tar an its variants, touch, echo,
who, whoami, ps, kill,makefile,etc.)
Assignment – Lab:
Getting Acquainted with the Linux Environment
Use various commands in Linux system.
Session 2
Lecture: Gaining confidence with Linux
Access control list and chmod command
chown and chgrp commands
Commands like telnet, ftp, ssh, and sftp
Basic of I/O system with mount and unmount.
vi editior
Features and different modes of vi editor
Editing using vi editor
Find and replace commands
cut-copy-paste commands
The set command
PG-DVLSI Page 1 of 4
ACTS, Pune
Suggested Teaching Guidelines for
Linux Shell Scripting & Python PG-DVLSI September 2022
Other related commands of vi
Assignment – Lab:
Review Exercises
Session 3
Lecture: Linux shell programming - 1
Introduction to Shells
a. What is shell?
b. Different types of Linux shells
c. Bourne Again Shell (BASH)
d. Shell variables (environment and user defined)
e. Shell files (.bashrc, .profile, .bash_profile, .bash_logout)
f. Positional parameters
Get start with simple scripts ( User variable, expr, multiple command)
Wild cards (* and ?)
Command line arguments
Arithmetic in shell scripts
Assignment – Lab:
Review Exercises
Session 4
Lecture: Linux shell programming - 2
Read and echo commands in shell scripts
The tput command
Taking decisions:
o if-then-fi
o if-then-else-fi
o The test command (file tests, string tests)
o Nested if-elses
o The case control structure
Assignment – Lab:
Review Exercises
Session 5 & 6
Lecture: Linux shell programming - 3
The loop control structure
o The while, until and for loop structures
o The break and continue statements
Shell metacharacters
Command line expansion
Directory stacks manipulation
Job control, history and processes
Builtins and functions
Shell Files
PG-DVLSI Page 2 of 4
ACTS, Pune
Suggested Teaching Guidelines for
Linux Shell Scripting & Python PG-DVLSI September 2022
Assignment – Lab:
Review Exercises
Session 7
Lecture: Tool Command Language (TCL)
TCL basics
o Scripts,command and words
o Evaluating a command
o Variable,command and backslash substitutions
o Quoting and comments
Variables
Expressions
o Operators
o Substitutions
Control flow
Control structure
Assignment – Lab:
Write a TCL script to display “Hello World” on console.
Use TCL commands to
o Find the length of a string
o return a list comprising of all the arguments specified.
o change the value of a global variable from inside a procedure’s scope
o Replaces a value with a given value
Create a TCL script to check whether the given string is a palindrome or not.
Write TCL script to convert between character and its ASCII value.
Write TCL script to generate random number.
Write TCL script to arrange numbers in ascending/descending order.
Write TCL script to display the given string in reverse order.
Session 8:
Lecture: Introduction to Python
What is Python?
Python Scripts
Print function
Literals
Quoting rules in Python (Single, double, triple)
Arithmetic and Assignment operators
Comparison and Logical operators
Identity, membership and Bitwise operators
Assignment – Lab:
Review Exercises
Session 9:
Lecture: Flow Control
If, elif, else
PG-DVLSI Page 3 of 4
ACTS, Pune
Suggested Teaching Guidelines for
Linux Shell Scripting & Python PG-DVLSI September 2022
For loop, while loop
break
continue
pass
Assignment – Lab:
Review Exercises
Session 10:
Lecture: Basics of Python Programming
Numbers and String
Lists and Tuples
Dictionary
Sets
Standard I/O operations (file handling)
Assignment – Lab:
Review Exercises
Session 11:
Lecture: Python functions Regular Expression
Introduction to function
Parameters and arguments in function
Introduction to Regex
Regex module
Regex functions
Meta characters
Special sequences
SETS
Pattern matching
Assignment – Lab:
Review Exercises
Session 12:
PG-DVLSI Page 4 of 4