skip to navigation skip to content
- Select training provider - (Department of Physics - Health & Safety)
Mon 10 Jun, Wed 12 Jun, Fri 14 Jun 2019
14:00 - 17:00

Venue: Phoenix Teaching Room 1, New Museums Site

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

Mon 10 Jun, Wed 12 Jun, Fri 14 Jun 2019

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.

Target audience
  • All current University members (departments and colleges)
  • Further details regarding eligibility criteria are available
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: 3

# Date Time Venue Trainers
1 Mon 10 Jun 2019   14:00 - 17:00 14:00 - 17:00 Phoenix Teaching Room 1, New Museums Site map Dr. David McBride,  Ben Harris
2 Wed 12 Jun 2019   14:00 - 17:00 14:00 - 17:00 Phoenix Teaching Room 1, New Museums Site map Dr. David McBride,  Ben Harris
3 Fri 14 Jun 2019   14:00 - 17:00 14:00 - 17:00 Phoenix Teaching Room 1, New Museums Site map Dr. David McBride,  Ben Harris
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 half day sessions

Related courses
Themes

Booking / availability