Shell and Perl Programming I
Level 5, 20 Credits.
We have 1 upcoming course
(Mondays from 6:00 pm to 9:00 pm plus 1 Saturday Day School )
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.
Who is this course for?
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
Schwartz, R.L., Phoenix, T. (2001) Learning Perl. O’Reilly & Associates, 3rd edition