Skip to main content

Shell and Perl Programming I

This course is currently unavailable for booking

There are currently no upcoming dates available for this course. Be the first to know when new dates are announced by joining the mailing list.

This course will provide an introduction to the UNIX operating system, the use of the awk scripts using awk functions to process text data, the use of shell and Perl scripts.

Topics covered in the introduction to the UNIX operating system include a discussion of the file hierarchy, the use of essential file and directory commands, and, finally, file and directory access.  Topics covered in the shell scripting language will include the four phases of shell interpretation, namely, command substitution, parameter substitution, blank space interpretation and filename generation, shell parameters and quoting.

Topics covered in the Perl scripting language include:

  • An introduction to mathematical operators and functions
  • Comparison operators and the use of conditional and iterative control statements
  • Use of chop and chomp functions with keyboard input
  • Use of the diamond operator () to read a text file
  • Use of arrays and array functions
  • Use of string operators and string functions
  • Accessing files via filehandles
  • File tests
  • Logical operators
  • Pattern matching
  • Data validation using predefined character class abbreviations.

Assessed work will include the writing of  scripts.

This course is ideal for the student who wants a good general introduction to computer programming.

Learning and teaching

This module includes a mix of traditional lectures and laboratory sessions. Each meeting starts with a lecture and finishes with a laboratory session.

Coursework and assessment

To award credits we need to have evidence of the knowledge and skills you have gained or improved. Some of this has to be in a form that can be shown to external examiners so that we can be absolutely sure that standards are met across all courses and subjects.

During the course, you will be given assignments to be submitted to the course tutor. At the end of the course, there will be a class test.

The most important element of assessment is that it should enhance your learning. Our methods are designed to increase your confidence and we try very hard to devise ways of assessing you that are enjoyable and suitable for adults with busy lives.


  • Introduction to some essential UNIX commands
  • Controlling access of files and directories using the chmod command
  • Introduction to the Shell (UNIX Command Interpreter)
  • Discussion of the four phases of shell interpretation, namely command substitution, parameter substitution, blank space interpretation and filename generation
  • Shell programs (scripts) and shell parameters
  • Use of the if, for, while and case program constructs in the Bourne shell
  • Use of the if, foreach, while and switch program constructs in the C shell
  • Use of logical operators in both the Bourne and C shells
  • Keyboard input in both the Bourne and C shells
  • Use of the awk command to process a file of data
  • Using awk functions within awk scripts
  • Introduction to Perl scripts
  • Use of mathematical operators and functions in Perl
  • Comparison operators and the use of the if, while, do while, until, do until and for statements
  • Use of the diamond (<>) operator to process the contents of a file
  • Use of arrays in Perl and initialisation of an array from keyboard input
  • Using string operators and string functions in Perl
  • Using filehandles to access files and the die and eof functions

Reading suggestions

  • Schwartz, R.L., Phoenix, T. (2001) Learning Perl. O'Reilly & Associates, 3rd edition

Library and computing facilities

As a student on this course you are entitled to join and use the University’s library and computing facilities. Find out more about using these facilities.


Our aim is access for all. We aim to provide a confidential advice and support service for any student with a long term medical condition, disability or specific learning difficulty. We are able to offer one-to-one advice about disability, pre-enrolment visits, liaison with tutors and co-ordinating lecturers, material in alternative formats, arrangements for accessible courses, assessment arrangements, loan equipment and dyslexia screening.