logoalt Hacker News

hnlmorgyesterday at 6:35 PM4 repliesview on HN

I don’t see how they’re any worse than spaces in file names, which is an edge case you need to cater for already anyway.


Replies

eklitzkeyesterday at 6:45 PM

You only "need" to do this if you are handling arbitrary untrusted filenames. It's pretty common for people to write shell scripts that are only used for handling files they create that don't have unusual characters, and these shell scripts work just fine.

show 1 reply
hn993302yesterday at 8:14 PM

I don't want spaces either. Of course your scripts should never assume any of this, and this only matters when doing stuff manually (or ai-yolo) in the shell.

Gibbon1yesterday at 10:19 PM

God sent Captain Crunch to warn mankind of the dangers of in band signaling but they did not heed his warning and continued to sin.

crabboneyesterday at 10:02 PM

They also have single quote, dollar and backtick... this is a lot worse than just whitespace. The problem with whitespace surface when the programmer made no effort to escape the string used as a file name. This adds a whole new vector of problems that happen when the programmer tried to escape the string, but it didn't work.

It was too long ago, so, I've forgotten the names, but I remember the saga with PHP escaping (and failing) SQL queries (some sort of sql_real_now_honest_real_escape_string() function or something like that).

show 1 reply