Post History
Unix is very permissive with filenames, and this can sometimes lead to a bunch of annoying corner cases when printing files. A well known example is when you put a newline in a filename, and it bre...
Question
filesystem
#2: Post edited
- Unix is very permissive with filenames, and this can sometimes lead to a bunch of annoying corner cases when printing files. A well known example is when you put a newline in a filename, and it breaks naive parsing of a file list later in the pipeline.
- There's not much mystery around why Unix decided to be permissive with filenames, so I'm not asking why newlines are allowed in filenames.
However, are there any situations where it is *useful* (or necessary, or desirable...) to have newlines in filenames?- I've only seen it when someone is deliberately trying to set up a trap (hacking, pranks) or by accident (programmer forgot to add a whitespace normalizer to their filename generator).
- Unix is very permissive with filenames, and this can sometimes lead to a bunch of annoying corner cases when printing files. A well known example is when you put a newline in a filename, and it breaks naive parsing of a file list later in the pipeline.
- There's not much mystery around why Unix decided to be permissive with filenames, so I'm not asking why newlines are allowed in filenames.
- However, are there any situations where it is *useful* (or necessary, or desirable...) to have newlines in filenames? Hypothetical is okay, but "in the wild" would be even better.
- I've only seen it when someone is deliberately trying to set up a trap (hacking, pranks) or by accident (programmer forgot to add a whitespace normalizer to their filename generator).
#1: Initial revision
Are there any legitimate uses for newlines in filenames?
Unix is very permissive with filenames, and this can sometimes lead to a bunch of annoying corner cases when printing files. A well known example is when you put a newline in a filename, and it breaks naive parsing of a file list later in the pipeline. There's not much mystery around why Unix decided to be permissive with filenames, so I'm not asking why newlines are allowed in filenames. However, are there any situations where it is *useful* (or necessary, or desirable...) to have newlines in filenames? I've only seen it when someone is deliberately trying to set up a trap (hacking, pranks) or by accident (programmer forgot to add a whitespace normalizer to their filename generator).