TIL: 2020-03-13
How to Fix “Illegal” Line Endings in Windows
I was running a bash program which prints each line from a text document containing URLs, then curls the URL, uses the result, etc. However, no matter how nice it looked when I tested it by echoing out the data, I kept getting the response curl: (3) Illegal characters found in URL
Thanks to this super helpful Stack Overflow answer, I got everything sorted out.
When I ran
cat -A filename.txt
I saw a bunch of weird line endings which weren't showing up in the Git Bash editor I use for writing/running Bash scripts in Windows 10. After a quick check on its function, I followed the advice to run
dos2unix filename.txt
after doing so, I ran the cat -A
command again and no longer saw the weird line endings. Running my original script worked exactly as I'd expected it to.
Earliest MARC Experiments Had Weird Stuff Going On
I've been reading about the early forms of the MARC standard for a research project. Four highlights from today's reading:
- Early delimiters were just the
#
(or$
in some special cases) so you might havePlace,# Publisher,# Date#
orPlace,# Date# Price
. orU.S.# Library of Congress
. - They thought they could come up with a controlled list of publishers. Bless.
- Fixed Field 24 [104] was for recording whether a record was new this week (N), created last week (O), revised this week (R), or more than 2 weeks old (blank). Can you imagine the maintenance?
- Fixed Field 20 [59-60] was for the height of the volume in centimeters. That's pretty cool data, actually.
A fun idea someone had for what they could do if MARC were invented? Create a machine-readable list of professorial interests and send them customized info on new library aquisitions.