Page 1 of 1

dos2unix.exe needed?

Posted: Fri Jan 05, 2018 7:06 pm
by Bryy
So, apparently some of my users can't play the Linux versions of my games, saying that I need to run dos2unix to convert files.

Anyone else have this problem with Linux users?

Re: dos2unix.exe needed?

Posted: Fri Jan 05, 2018 10:38 pm
by Apa
Android is a Linux variant and dos2unix is not needed definitely.

Re: dos2unix.exe needed?

Posted: Sun Jan 07, 2018 8:04 pm
by Imperf3kt
Why would Linux users require a Windows executable?

This sounds fishy

Re: dos2unix.exe needed?

Posted: Sun Jan 07, 2018 8:41 pm
by Bryy
Yeah, I've been trying to get more information. Now they tell me they can run it fine but they still need this?

Re: dos2unix.exe needed?

Posted: Sun Jan 07, 2018 10:37 pm
by Imperf3kt
A quick Googling gives me https://en.wikipedia.org/wiki/Unix2dos

It states that it is a CLI tool which converts *nix line endings, to Windows format line endings.
Using some simple logic, dos2unix is the reverse.

What editor do you use when scripting your game files?
From the sounds of it, it is using MLE (Mixed Line Endings), in other words the following:

Hello world.
My name is Imperf3kt

Is appearing to them, as the following instead

Hello world.\nMy name is Imperf3kt.


Some additional info:
https://en.wikipedia.org/wiki/Newline

Re: dos2unix.exe needed?

Posted: Mon Jan 08, 2018 1:27 am
by Bryy
I'm using JEditor.

EDIT (1/20/2018):

Now someone else is telling me that I need to put:

Code: Select all

sed -i 's/\r//' SUPERARMY3.sh
In my code somewhere.

I've researched this and it seems like I need to put it in my .sh files, but nothing tells me WHERE in the file to put it.

I don't want to screw up and make something worse.

Re: dos2unix.exe needed?

Posted: Fri Jan 26, 2018 12:48 pm
by ThrashNeon
Bryy wrote: Mon Jan 08, 2018 1:27 am I'm using JEditor.

EDIT (1/20/2018):

Now someone else is telling me that I need to put:

Code: Select all

sed -i 's/\r//' SUPERARMY3.sh
In my code somewhere.

I've researched this and it seems like I need to put it in my .sh files, but nothing tells me WHERE in the file to put it.

I don't want to screw up and make something worse.
They weren't telling you to put that into your code..

They said that THEY ran that command on your SUPERARMY3.sh file to fix the line endings in that file. They used sed (a *nix utility) to replace the line endings.

You need to make sure the SUPERARMY3.sh file is saved with the correct line endings for linux. I suspect that you created this file in JEditor, and it saved the file with Windows line endings by default.

I would expect there is somewhere in Jeditor for you to check/change line endings in the file.

Re: dos2unix.exe needed?

Posted: Fri Jan 26, 2018 2:01 pm
by Bryy
I fixed it, thanks.