Jun 30, 2025  
Catalog 2024-2025 
    
Catalog 2024-2025 [ARCHIVED CATALOG]

CIS 240U Advanced Unix/Linux - BASH Shell


Lecture Hours: 4
Credits: 4

Construct Linux shell script programming using the Bourne Again shell programming language (bash) and Linux utilities to create practical shell scripts. Topics covered include customizing the environment, running and writing scripts, variables, loops, functions, text processing and debugging.

 

Prerequisite: CIS 140U  with a grade of C or better; or consent of insturctor.
Differential Fee Yes
Student Learning Outcomes:
 

  1. Use command substitution to capture program output.
  2. Use conditional statements to control the execution of shell scripts.
  3. Write shell scripts to perform repetitive tasks using while and for loops.
  4. Design and implement shell functions.
  5. Identify and process command-line arguments.


Content Outline
 

  • Review of Basic Unix Concepts
    • Shell differences
    • Script basics
    • Working with files and directories
    • Using find to locate files and directories by name pattern and type
    • Manipulating file attributes: owners, groups and permissions.
    • Using text filters such as head, tail, cut, tr, sort, uniq, grep, sed and awk.
    • Basic regular expressions
  • Shell Programming
    • Script Basics
    • Variables
      • local
      • environment
    • Substitution
      • shell wildcards
      • variable
      • command
      • arithmetic
    • Quoting
      • backslashes
      • single quotes
      • double quotes
      • quoting rules
    • Flow Control
      • the test command
      • the if statement
      • the case statement
      • conditional operators
    • Loops
      • the for loop
      • the while loop
      • break and continue
    • Documentation
      • Comments
      • Indentation
    • Parameters
      • special variables
      • options and arguments
      • using ‘set’ to set command line arguments
      • command-line option parsing in shell scripts
    • Input/Output file descriptors and redirection in scripts
      • standard input, standard output, and standard error
      • output redirection
      • input redirection
      • combining output streams
      • using the read command to read data from files and interactively from the user
    • Functions
      • creating and using functions
      • scoping issues
    • Miscellaneous Topics
      • re-evaluation of the command using eval
      • the null command
      • using type to show how commands are resolved
      • using sleep to implement delays
      • use of temporary files with unique filenames generated using $$ or mktemp
      • creation and use of variables containing file paths
      • sourcing using the . (dot) operator
  • Advanced Topics
    • Debugging
      • shell tracing
      • adding conditional debugging code
    • Function Libraries
      • creating a library of functions
      • useful functions
    • Steps in designing a script
    • Techniques for increasing portability