2
wget https://some.url/with/a/file.txt

Returns No such file or directory despite file.txt being present at the location (can be downloaded via browser). Also the directory to save to is writeable by the user running the command.

steros
  • 1,626
  • 1
  • 23
  • 60
  • StackOverflow is dedicated to helping solve programming code problems. Your Q **may be** more appropriate for [su] , but read their help section regarding on-topic questions . AND please read [Help On-topic](https://stackoverflow.com/Help/On-topic) and [Help How-to-ask](https://stackoverflow.com/Help/How-to-ask) before posting more Qs here. Good luck. – shellter Jul 08 '20 at 00:10
  • Does this answer your question? [Are shell scripts sensitive to encoding and line endings?](https://stackoverflow.com/questions/39527571/are-shell-scripts-sensitive-to-encoding-and-line-endings) – tripleee Feb 01 '22 at 06:24

1 Answers1

11

There are a lot of related threads but nothing helped.

Finally found out there is an illegal character in front of the url!

That was so hard to find I post it here in case anyone stumbles upon the same.

steros
  • 1,626
  • 1
  • 23
  • 60
  • Care to elaborate? What was the illegal character? – Eric Wolf Dec 04 '20 at 02:59
  • 1
    Sorry I only remember it wasn't "visible" so I think it must have been U+FEFF or one of these: U+200B, U+200C, U+200D, U+200E,U+200F. – steros Dec 08 '20 at 13:05
  • 1
    This happened to me copying the curl command from another application to the terminal. At the terminal prompt I had to delete the spaces and re-insert them for it to work. Thank you for the suggestion. – vegemite4me Mar 23 '21 at 12:10