Day 1 (variables, functions, environments) - Linux shell scripting 2024
Channel: Aalto Scientific Computing
Date: 2024-01-16

This day mainly covers ways to make scripts (basics, like where to put them to be executable), variables, functions, and environment variables.  There is a brief extra bit about redirections.

Most material https://aaltoscicomp.github.io/linux-shell/variables-functions-environments/

Redirections: https://aaltoscicomp.github.io/linux-shell/quoting-substitution-aliases/#more-about-redirection-piping-and-process-substitution

00:00 § Writing scripts, editors
12:49 Exercise prep (basics, ~/bin and PATH)
14:41 After the exercise
20:35 § Variables
28:46 Exercise 2 (variable)
30:28 After the exercise
30:28 Magic of bash variables
38:11 Exercise 3 (more variables)
40:18 After the exercise
46:58 Wrap-up of variables
47:41 § Functions
1:10:21 Exercise 4 (functions)
1:12:17 After the exercise
1:21:34 § Redirections
1:32:58 Exercise 5 (solution tomorrow)

-----

You might have already used Linux shell commands interactively, but how do you go from interactive terminal use to non-interactive workflow with scripts? This course is oriented on those who want to start using BASH programming fully and use terminal efficiently.

We expect that course participants are familiar with the shell basics (experience with BASH, ZSH, etc). We somewhat touch the Part 1 of the Linux Shell tutorial, and continue to Part 2. Though we expect that participant knows how to create a directory and can edit file from the linux shell command line. We will be scripting a lot, there will be lots of demos and real practicing.

Playlist: https://www.youtube.com/playlist?list=PLZLVmS9rf3nOXyXh0TEgGhS7bUdOT0dGg

Course webpage: https://scicomp.aalto.fi/training/scip/shell-scripting-2024/

Aalto Scientific Computing: https://scicomp.aalto.fi/