earthbound19 / _ebDev

Various tools, mostly custom-made for art development.
2 stars 2 forks source link

Solve the dang cygwin windows newline problem, everywhere #6

Open earthbound19 opened 6 years ago

earthbound19 commented 6 years ago

UPDATE: stop using any gnu utilities ports that create windows newlines (such as those that come with cygwin), and use only ones that don't (such as from MSYS2).

items in this problem:

Case with find vs. gfind: https://serverfault.com/a/354407/121188

earthbound19 commented 4 years ago

For the umpteenth time I've discovered that sed / gsed (EDIT: but what about the cygwin version?) on windows inserts #@$! windows newlines, and that any stream-created variables with that must append this--as it says in this issue:

| tr -d '\15\32'

(removes windows newline)

earthbound19 commented 4 years ago

python strings passed via argsparse are mucky on windows. solved with stringVariable.rstrip() re a genius breath yonder

earthbound19 commented 4 years ago

Investigate whether msys2 tools don't cause CRLF (control linefeed / windows newline) problems?

OR per updated issue note (first sentence).

earthbound19 commented 4 years ago

the sed.exe that ships with MSYS2 does not cause this issue. It's 100% an issue with Cygwin's sed.exe. Witnessed in fixing a bug manifest on Windows in hexplt2ppm.sh (it produced wrong colors via Gygwin sed.exe (hax renamed to gsed.exe by me), and did not produce the issue with MSYS2 sed.exe (hax renamed to gsed.exe by me).

Dumping Cygwin sed. DELETE the blankety-blank file after install unless/until migration to MSYS2 toolchain.

earthbound19 commented 4 years ago

Updated OP with checklist and progress of checklist.

earthbound19 commented 4 years ago

But this may be a more efficient way to remove windows newlines if you must; test before using:

re: https://stackoverflow.com/a/19347380/1397555 variable=${variable//[$'\t\r\n']}

earthbound19 commented 5 months ago

^ THAT!