I am trying to remove all spaces on a file without messing with line endings. This is to be run from inside a bash script.
I have tried all the solutions here: https://stackoverflow.com/questions/9953448/how-to-remove-all-white-spaces-from-a-given-text-file
They work from the command line but when I try them from the bash script the final file is a mess, completely destroyed.
File is using UNIX file endings.