Open ak2766 opened 8 years ago
I tried to duplicate this and could not. Running
dos2unix --info apt-cyg/apt-cyg/apt-cyg
I get
0 673 0 no_bom text apt-cyg/apt-cyg/apt-cyg
ie 673 unix line endings, zero of any other type.
OK - this is interesting.
I just checked out the code on my Ubuntu desktop and I see no ^M
symbols. However, cloning this in cygwin on Windows (where I intend on running it), I see the ^M
at the end of each line!
Could be that Git on Windows is converting from unix2dos!
This error happens whenever you save a UNIX script with a program that inserts Windows line endings. That includes git
that is configured with core.autocrlf true
.
So, not an apt-cyg
bug.
As a quick dirty fix for this in windows you can open the apt-cyg file in notepad++ then use the ctrl+f and replace function to remove the "carriage return" \r characters. Select the Regular Expression radio button Find what:\r replace with: replace box should be empty that means no spaces or anything at all. click replace all, then save and try the command again in cygwin
As a quick dirty fix for this in windows you can open the apt-cyg file in notepad++ then use the ctrl+f and replace function to remove the "carriage return" \r characters. Select the Regular Expression radio button Find what:\r replace with: replace box should be empty that means no spaces or anything at all. click replace all, then save and try the command again in cygwin
unfortunately i couldnt find any "\r" to replace with. (Oh my god im starting to think about the murphy's law; " Every solution breeds more problems lol)
As a quick dirty fix for this in windows you can open the apt-cyg file in notepad++ then use the ctrl+f and replace function to remove the "carriage return" \r characters. Select the Regular Expression radio button Find what:\r replace with: replace box should be empty that means no spaces or anything at all. click replace all, then save and try the command again in cygwin
This did the trick for me, thank you.
Looks like someone has modified the apt-cyg script on windows and forgot to run dos2unix on the file before committing! I was getting this error when attempting to execute the script:
Fixed by running:
sed -i 's/
Ctrl+V Enter $//' apt-cyg