/Script-Samples-30640

A repository of scripts used to demonstrate concepts in bash and programming

Primary LanguagePython

Sample Scripts

This repository contains sample scripts to show certain concepts for UCD COMP30640. The scripts may be in a variety of programming and scripting languages, usually python or bash

Obviously, this repository does not contain answers to any practicals, but contains some examples that you can learn from and test on your own computer.

The index

make_directories_loop

Contains files that demonstrate how to use loops in bash.

make_lab_directories.sh uses a for loop and a predefined list

make_lab_directories_while_loop_starter.sh uses a while loop and command line arguments to create lab directories. However, it's incomplete. The intention is for students to use their bash knowledge to complete it

make_lab_directories_while_loop_finish.sh is the completed version of make_lab_directories_while_loop_starter.sh

recursion

Recursion can be complicated to get your head around. This directory contains samples used to demonstrate this method of programming

recursive_countdown.py, and the python3 alternative, counts down from a specific value, passed as a command line argument. It uses prints to trace the running of the program.

A video that might help.

Alt text