Get the latest tech news

Whence '\n'?


If you do just foo, the following justfile will write a single byte 0x0A to a file named bar: x := "\n" foo: printf '{{x}}' > bar Let's find out where that 0x0A byte comes from. just is written in Rust, and the just parser has a function called cook_string, which transforms a just string token containing escape sequences into a UTF-8 string.

computers · programming If you do just foo, the following justfile will write a single byte 0x0A to a file named bar: So when have a\n character escape in your justfile, the just binary contains a 0x0A byte in some form, which it will then write to your final string. All credit to the original author for noticing how interesting this rabbit hole is.

Get the Android app

Or read this on Hacker News