The issue has been resolved in comments. This answer is an extract for future users with similar problem.
Probable cause:
If that wget
command is in a script file, and the file has DOS-style line endings, then the carriage return will get appended to the filename.
This is because Linux (Unix-like system in general) expects \n
(another notation: LF
) as a line ending. DOS and Windows use \r\n
(CR+LF
). This additional \r
is interpreted by Linux as any normal character – as a part of the line, in this case as a part of the filename.
More information on Wikipedia.
OP's solution:
wget -O "count.txt"
It might solve this particular problem, but the additional \r
is probably still there at the end, not as a part of filename though. The general, recommended solution:
You should fix the file format instead: use dos2unix
on that file.
2If that wget command is in a script file, and the file has DOS-style line endings, then the carriage return will get appended to the filename. – glenn jackman – 2016-10-21T19:46:00.787
Thank-you very much! I've found a solution based off of your advice. I've changed the command format, now I'm running: wget -O "count.txt" http://mywebsite.com/app/count.php
– Clarity – 2016-10-21T19:48:59.0272You should fix the file format instead: use
dos2unix
on that file. – glenn jackman – 2016-10-21T19:56:17.887