Overview

This tutorial introduces the basics of shell script programming with Bash, the Bourne Again Shell. The course starts by introducing Bash, the standard command line tool on Unix, and by basic file and directory operations. Next, we discuss variables, loops and scripting in Bash, as well as manipulating text files. Finally, we will have a look at awk, a powerful tool for data extraction and reporting.

Course organisation

If you follow this tutorial as part of the course SBC.07110 - Introduction to UNIX and Bash, it will be organized as follows: The 12 chapters will be discussed on four full days, always Mondays and Wednesdays. Each day will begin with a lecture during which we present and illustrate all topics. Then, you will have time to re-read the material through this tutorial and work on exercises. An additional half-day, Friday afternoon, is reserved as extra time to work on the exercises.

Here is an overview of the material planned for each day:

First Monday

  • Introduction
  • Files and Folders
  • Redirection
  • Variables
  • Conditionals & Loops

First Wednesday

  • BASH Scripts
  • Text files

First Friday

  • Extra time to work on the exercises

Second Monday

  • Zipping
  • Filtering & Editing

Second Wednesday

  • AWK
  • Using R with BASH

Second Friday

  • Extra time to work on the exercises

Please see the timetable to get room numbers for these sessions.

During the course, we will use slides available here.