Unix: Simple Shell Scripting for Scientists Prerequisites
This course is part of the Scientific Computing series.
No previous experience of shell scripting is required for this course; however some knowledge of the interactive use of the bash shell is a prerequisite (see Simple Shell Scripting for Scientists: Prerequisites for details).
This course introduces shell scripting in bash for scientific computing tasks. Day one introduces very basic shell scripts in bash which process the command line in a simple fashion. Day two covers how to write more advanced shell scripts in bash. Day three covers how to make one's shell scripts more robust.
At the end of each day one or more exercises are set. It is VERY IMPORTANT that attendees attempt these exercises before the next day of the course. Attendees should make sure that they have allowed themselves sufficient study time for these exercises between each day of the course.
- Knowledge of the interactive use of the bash shell as might be obtained by attending the "Unix System: Introduction" course: for details see Simple Shell Scripting for Scientists: Prerequisites
- Familiarity with a plain text editor (e.g. Emacs, gedit, Pico, vi) on a Unix system as might be obtained from either the Emacs or vi Editor courses (also briefly covered on the "Unix System: Introduction" course).
Number of sessions: 3
# | Date | Time | Venue | Trainers | |
---|---|---|---|---|---|
1 | Fri 12 Mar 2010 09:30 - 13:00 | 09:30 - 13:00 | Department of Applied Mathematics and Theoretical Physics, Meeting Room 16, GL.04 | map | Julian King, Bruce Beckles |
2 | Mon 15 Mar 2010 09:30 - 13:00 | 09:30 - 13:00 | Department of Applied Mathematics and Theoretical Physics, Meeting Room 16, GL.04 | map | Julian King, Bruce Beckles |
3 | Thu 18 Mar 2010 09:30 - 13:00 | 09:30 - 13:00 | Department of Applied Mathematics and Theoretical Physics, Meeting Room 16, GL.04 | map | Julian King, Bruce Beckles |
- What is a shell script and how does it work?
- Writing very simple shell scripts
- Writing more advanced shell scripts
- Simple use of shell variables and parameters
- Simple use of some shell builtin commands: cd, echo, exit, pwd, read, return, source, set, test
- Shell flow of control constructs: for, if, while
- The mktemp command
- Shell functions
- Command substitution
- Arithmetic expansion
- Pipelines
- Handling filenames
- Obtaining input from the keyboard/standard input
- Redirecting standard output and standard error
- Simple processing of the command line
- Handling errors in shell scripts
- Translating your task into a shell script
- Structuring shell scripts
- Testing and debugging shell scripts
Presentations, demonstrations, practical exercises and home study.
SUSE v. 11.1 on PWF Linux
- Please ensure you can attend all three sessions.
- Please ensure you set aside some time between sessions for attempting the exercise(s) set at the end of the previous session.
- People requiring very advanced shell programming skills are recommended to learn Python instead. The "Programming: Python for Absolute Beginners" course may be of interest in this regard.
- As this course is part of the Scientific Computing series, all the examples chosen are more relevant to scientific computing than system administration.
- Those attending this course may find it useful - once they have completed this course - to have a look at the "Unix Systems: Further Commands" course notes as these notes introduce more sophisticated Unix commands that could be used in shell scripts.
Three half day sessions
Booking / availability