I'm guessing you put a new-line after the -w (otherwise it would not report line 2). A common cause of these kinds of errors is where the script is not in a text file format. Did you use a non-text format to save the script file, such as rtf or Word format? It should be a text file with no formatting.