Showing posts with label Homework. Show all posts
Showing posts with label Homework. Show all posts

Tuesday, April 26, 2011

Bash Scripting Homework - Extra Credit

This assignment is for extra credit and due by Friday, April 29th at 5:00 pm 10:00 am.  (Correction for when grades are due)

Write a bash script to correct typos in file names.  It should take two arguments - the first is the typo and the second is the correction.  It should replace all instances of the typo with the correction in the file names in the current directory.  If only one argument is supplied, then it should simply delete the typo from the file names.  If either zero or more than two arguments are supplied, the script should output a message alerting the user that the script requires 1 or 2 arguments.

Save this script as bash_extra.sh and email it to the instructor.

Thursday, March 31, 2011

Wednesday, March 16, 2011

sed and awk Homework

Here is the homework over sed and awk, due next class:

Here are two files that you will need to complete the homework:

Wednesday, February 9, 2011

Bash Part 2 and Vi/Vim Homework

Here is this week's homework and associated file:

I realized that in the lecture notes, I forgot to go over how you save and how you close out of a file in Vi/Vim.  From command mode, use the following
  • :w - this will save the current file
  • :w filename - this will save the current file with the name "filename"
  • :q - this will quit Vi/Vim
  • :q!  - this will quit Vi/Vim discarding any changes to the document
  • :wq - this will save and quit the current document
Also, I think there was a typo on the lecture slides, and until I get a chance to fix it, here's a correction.  The find/replace (or substitute) command needs to begin with a colon ( : ) character.  For example, replacing every letter a with the letter b in a file would be done as:
  • :%s/a/b/g

Tuesday, January 25, 2011

Bash Homework

Today, also marks the first homework assignment for the class.  Homework is due by the beginning of class February 1, 2011.  Here is the link to the homework assignment: