I'm trying to echo the contents of this link and it exhibits what to me is bizarre behavior.
git@gud:/home/git$ URL="https://raw.githubusercontent.com/fivethirtyeight/data/master/births/US_births_1994-2003_CDC_NCHS.csv"
git@gud:/home/git$ content=$(wget $URL -q -O -)
git@gud:/home/git$ echo $content
2003,12,31,3,12374_month,day_of_week,births
I expected this code to print the contents as I see them when I open the link on a browser. But instead, the output, on its entirety, is 2003,12,31,3,12374_month,day_of_week,births, that's it.
I actually see this behaviour locally as well, after downloading the file. Tried it both using curl and simply copy and pasting into a text editor and saving the file. They all exhibit the same behavior. The same happens with cat, cut, head, tail and even awk.
This doesn't happen with other files and works fine on Python. What am I missing? How do I get it to work?
I realize that the file doesn't end with a new line character, but adding it doesn't fix it.
I'm on Ubuntu 18.04.1 LTS and the CLI I'm using is Bash release 4.4.19(1).
2003,12,31,3,12374_month,day_of_week,births, that's it. Nothing more. It's the last line over a part of the first line....to indicate that the middle has been omitted). Try to make it so that, if someone is not able to access the file at the link, they can still understand what's going wrong.