Create an Assignment Assignment

I think this assignment was a great idea. It allows the students to add input into what they think this course should cover. For this assignment, I chose to have the reader write a bash script file. Scripting is an important tool that Linux provides. It allows you to execute lines of code without you having to type all of them in. It also allows for conditional statements to change what will execute.

In my assignment, I had the reader create a bash script to check for changes on a website. This would be particularly useful when checking for some sort of update. For instance, if you want to see if VT has canceled class and don’t want to check the website continuously, you could use this script. The assignment that I created specifies that the bash script do the following in an infinite loop:

  1. Download an html web page
  2. Wait some amount of time
  3. Download the same html webpage
  4. Display the differences between the two files

In the finish script, I ended up using:

  1. wget
  2. cat
  3. sed
  4. sleep
  5. diff

While working on the final script, I found it easier to remove all of the html tags with:

sed –e :a –e ‘s/<[^>]*>//g;/</N;//ba’

Then I would use diff and pipe that to another sed command to get the formatting I wanted.

Throughout the completion of the assignment, it forced me to gain a more in depth experience with mostly sed.

Basic Shell Commands and Python Exercises

Basic Shell Commands

This week in ECE 2524, we took a look at some of the basic shell commands listed below.

alias diff man rmdir unalias
cat echo mkdir script whereis
cd exit more source which
cp hostname mv ssh whoami
chmod less pwd tar ps
date ls rm touch grep
find head tail ln wc

The exercise was pretty straight forward. As a small group, we divided the commands for each person to research. For each of our commands, we had to find the usage of the command, common flags and options, and some examples. In my opinion, the exercise would have been more helpful if after we discussed our commands, we had an exercise where we would have to use some or most of the commands. However, overall the exercise was a good learning exercise.

 

Python Exercises

We have been following along with an online book, Learn Python the Hard Way, that will teach us how to program in python. I have made it through exercise 9, and so far it has been very helpful. I have quite a bit of experience in various other languages, and this book helps me see the connection Python has with them. I look forward to going through the rest of the book.