I have been having line endings issues on bash scripts for several months. I have another, slightly older Macbook Pro which can run the same scripts without issue.
This has been happening for numerous scripts with different contents written by different people, in different folders. It has affected every script I have attempted to run for the past three months. They have come from Github repos that contain mostly Drupal projects that I've collaborated on with a variety of other developers, none of whom experienced this problem and who were unable to reproduce it with their versions of the scripts. I did not download them as zipped files. I always clone them. They are private repos that I can't link here.
I thought maybe it was related to my .bash_profile settings so I tried changing them to match those of my other machine, which didn't have any effect. I then tried removing all .bash_profile and .bashrc files completely (after backing them up). Again, no effect.
This question is not about how to change line endings, which is covered in similar questions. It is about how to figure out why all the line endings on scripts on my machine are different to those on my other machine and all my coworkers' machines.
This is a systemic problem affecting my whole computer and I'm looking for a a solution more permanent than editing an individual script. The bash version is GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12).