"in mode r" error

Moderators: cyao, soliday

Post Reply
Max
Posts: 50
Joined: 31 Jul 2008, 12:16

"in mode r" error

Post by Max » 09 Apr 2011, 15:07

Hi Michael and collaborators,
I have installed Elegant, SDDS ToolKit and Cygwin in a second laptop.
When I try to run a script as I do in my other computer (for instance, ./runScript in twissDerivatives example)
I receive the error:
in mode r: Invalid Argument

When I run a script that I use all the time in my old computer (saved in WorkPad), the new installation detects an error:
$'\r' : Command not found, although there is no "r" character in the line (I suspect it objects to a blank line).
This error is followed by other "command not found".

I installed the SDDS toolkit several years ago in my old computer; I naver had any problem and never updated it.

Thanks, cheers, Max

soliday
Posts: 391
Joined: 28 May 2008, 09:15

Re: "in mode r" error

Post by soliday » 11 Apr 2011, 09:05

Well my first thought is that this has something to do with the carriage return character. On Linux it is defined as /n and on Windows it is /n/r. I remember that the cygwin installation gives you the option to choose which style carriage returns to use. So I suspect that cygwin is looking for /n and Wordpad saved the script with /n/r, so the script is now seeing /r and thinking it is a command of some sort. I know that I cannot use Wordpad for editing scripts for this exact reason. Instead I have installed Xemacs for Windows. I believe it is also optionally included with cygwin.

Max
Posts: 50
Joined: 31 Jul 2008, 12:16

Re: "in mode r" error

Post by Max » 14 Apr 2011, 09:18

Thank you for your advice.
There is a little application called DOS2UNIX downloadable from the WEB that also fixes text file problems, and the one
I described in my note.
Regards, Max

Post Reply