Forum Discussion
Because Vin didn’t know, I’ll elaborate:
\r\n is a Windows style carriage return. Those two characters together are known as a carriage return and newline. Comes from when typewriters had two instructions to move to the new line: return the carriage to the beginning of the line and advance the roller one line.
\n is a Unix style carriage return, because Unix moved beyond typewriters back in the ‘70s and Microsoft didn’t.
Today they are practically equivalent. Most modern text editors will give you the option of using one or the other, despite your system’s OS. Many will detect what is already in use in a text file and will continue to use they. Most also give you a one click option to switch from one to the other a la replace(“\r\n”,”\n”).
The problem is that some programming language interpreters on Linux do not do well when presented with \r\n at the end of the line (especially the shebang line). It doesn’t treat \r\n as a single thing and instead reaches \r and doesn’t know what to do with it. It’s not a command or other kind of directive.
Windows systems do not have this problem because they properly interpret both \r\n and \n as equivalent.
For compatibility across all Collector platforms, none of the scripts should use \r\n and should use \n. I know LM knows this because in the same batch where this update was, there was a script that replaced all the \r\n’s with \n’s.
They also already have a linter for modules that checks all kinds of things. I wonder if they aren’t using it any more.
Related Content
- 2 years ago
- 3 months ago
- 4 months ago