Git and Unix Lab
CS3410 Spring 2015
Due in lab week of Mar. 24
Goal for Today
Write a simple bash script that concatenates files; setup a simple repository on BitBucket
What to submit
- submission.txt - A file with your netid as the first line, and containing your
git log for that repository in the rest of the file.
- script.sh - A script that generates that file for you.
What to do?
- Create an account on BitBucket
- Create a repository on that account
- Init and/or clone the repository
- Write your netid in netid.txt
- Make a bash script that creates your submission
Final contents of script.sh
cat netid.txt > submission.txt
git log >> submission.txt
For the adventurous
Write a script that prompts for your netid if there is no file netid.txt, writes it to netid.txt, and make your submission
like in script.sh
To test if a file exists:
if [ -f "file.txt" ];
For more info on UNIX, see man, Linux Pocket Guide (2nd Edition) by Daniel J. Barrett and slides