The quotes and double-quotes in the corrected lines originally submitted by Anonymous are not simple straight quotes, but curly “smart quotes” (most likely inserted by some MS Word or Outlook editor not designed for code).

Your script will fail if you simply copy and paste those lines from the web page into your text editor, as curly quotes are not valid delimiters in any shell.

Here is the corrected script as it is working on my FreeBSD system. I hope this will appear here unaltered: