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

No comments:

Post a Comment