CAD CAM EDM DRO - Yahoo Group Archive

Re: EMC mystery error?

Posted by Fred Proctor
on 1999-10-21 14:28:10 UTC
Brad Heuver wrote:

> but I'm now getting the
> 'nknown option: '-
>
> Usage: csh [ -bcdefilmnqrstvVxX] [arguement....]
> error that Tim G. had

This is because the file is DOS format, with CR-LF on the end. I
discovered this quite by accident. I wrote this up at the end of the
Help... menu file. Here's the writeup:

Q. My script gives syntax errors when I run it, like this:

'nknown option: `-
Usage: csh [ -bcdefilmnqstvVxX ] [ argument ... ].

A. Make sure the name of the command interpreter is the first
characters of the first line of the script, e.g.,

-----top of file---
#!/bin/csh -f

Also, the file might be in DOS format. The 'vi' editor will show this
in the status line, e.g., when you type "vi emc.run", you'll get a
screen editor with this at the bottom:

"emc.run" [dos format] 3 lines, 25 characters

(Exit vi with :q). If it's DOS format, it needs to be converted back
to Unix format, which means the CR characters (decimal 13) need to be
LF characters (decimal 10). This can be easily done at the Unix prompt
using the 'tr' text replace program, e.g.,

tr -d \\r < emc.run > new.run

which deletes all return characters, leaving the newlines alone, and
puts the result into new.run.

Discussion Thread

Brad Heuver 1999-10-21 10:05:30 UTC EMC mystery error? Fred Proctor 1999-10-21 14:28:10 UTC Re: EMC mystery error?