skip to navigation skip to content
- Select training provider - (University Information Services - Digital Literacy Skills)
Tue 22 Apr, Fri 25 Apr, ... Wed 30 Apr 2014
14:15 - 17:00
Venues:

Provided by: University Information Services - Digital Literacy Skills


Booking

Bookings cannot be made on this event (Event is completed).


Other dates:

No more events

[ Show past events ]



Register interest
Register your interest - if you would be interested in additional dates being scheduled.


Booking / availability

Unix: Simple Shell Scripting for Scientists
Prerequisites

Tue 22 Apr, Fri 25 Apr, ... Wed 30 Apr 2014

Description

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.

Prerequisites
  • 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).
Sessions

Number of sessions: 4

# Date Time Venue Trainers
1 Tue 22 Apr 2014   14:15 - 17:00 14:15 - 17:00 Phoenix Teaching Room 1, New Museums Site map Dr. David McBride,  Ben Harris,  Bruce Beckles
2 Fri 25 Apr 2014   14:15 - 17:00 14:15 - 17:00 Phoenix Teaching Room 1, New Museums Site map Dr. David McBride,  Ben Harris,  Bruce Beckles
3 Mon 28 Apr 2014   14:15 - 17:00 14:15 - 17:00 Phoenix Teaching Room 1, New Museums Site map Dr. David McBride,  Ben Harris,  Bruce Beckles
4 Wed 30 Apr 2014   14:15 - 17:00 * 14:15 - 17:00 * Titan Teaching Room 1, New Museums Site map Julian King,  Ben Harris,  Bruce Beckles
* Optional session.
Topics covered
  • 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
Format

Presentations, demonstrations, practical exercises and home study.

Materials
Taught using

MCS Linux

Notes
  • 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.
Duration

Three mandatory half day sessions, one optional half day session

Themes

Booking / availability