In order to successfully complete this assignment you need to participate both individually and in groups during class. If you attend class in-person then have one of the instructors check your notebook and sign you out before leaving class on Friday January 19.
✅ QUESTION: What are the key components of a programming language? What are the minimally useful set of commands you need to do something interesting in a programming language?
EXAMPLE: Run the following command in the BCCD Directory.
echo $PATH | sed -e "s/:/\n/g"
EXAMPLE: Run the following command in one of the BCCD_Examples
directory with a Makefile
.
cat Makefile | grep cd | grep MAKE | cut -d "d" -f2- | cut -d ";" -f 1 | sort | uniq
Challenge 1: Write a BASH script that uses squeue
, wc
and sort
to do something "useful".
Challenge 2: Write a submission script that takes a command as an input and runs the command 10 times and prints the time to the screen. For an extra challenge also print the average time.
Challenge 3: Write a bash script that renames all of the files in a directory with the out
extension to all uppercase.
Challenge 4: Write a bash script to start a program and make sure it only runs for 1 minute. If the program takes longer than a minute to run it should be "killed" an an error message printed to the screen. For simplicity, use the sleep 10
command as the "test" program. For an extra challenge allow the long running command to be passed into the script as an input variable.
If you attend class in-person then have one of the instructors check your notebook and sign you out before leaving class. If you are attending asynchronously, turn in your assignment using D2L.
Written by Dr. Dirk Colbry, Michigan State University
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.