I face two problems, whose cause might be the same, which is why I post them in one question.
This is my little shell script:
#!/bin/bash
wget "https://phantomjs.googlecode.com/files/phantomjs-1.9.2-linux-i686.tar.bz2"
Then I say ./script
.
I get bash: ././script: /bin/bash^M: bad interpreter: No such file or directory
Then I say to myself, okay, try bash script
instead of ./script
.
It seems to work, but the URL is then:
--2013-12-31 12:24:55-- https://phantomjs.googlecode.com/files/phantomjs-1.9.2-
linux-i686.tar.bz2%0D
Resolving phantomjs.googlecode.com... 173.194.69.82, 2a00:1450:4008:c01::52
Connecting to phantomjs.googlecode.com|173.194.69.82|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-12-31 12:25:01 ERROR 404: Not Found.
Do you recognize that my URL has an 2%0D
appended in line 2 after the file name?
When I run the command in my shell itself, not as a script, it works totally fine.
Do these two problems have the same root? Why is there a 2%0D
appended? I already looked for an empty space but did not find it.