home | list info | list archive | date index | thread index

Re: Directory starting with ''$'\n''

James via linux wrote on 2025-11-28 18:09:

Tab completion didn't work.
I suspect there is an invisible character.

I looked back at my earlier message and I need to retract most of it.

I had created a file called "\nbad_file" (no quotes, no linefeed).

There was no line feed in my file names because escaping only happens when it feels like it, or something.


I needed a "$" in there:

$ touch $'\nbad_file'
$ rm '
> bad_file'
removed ''$'\n''bad_file'


BUT, tab completion won't work, in fact it completely fails - there is one file in this directory, I type `rm [tab]` and it auto-completes... to a non-existent file name:

$ touch $'\nbad_file'
$ rm bad_file	## tab completion supplied the file name
rm: cannot remove 'bad_file': No such file or directory


And, wildcards fail too, in some cases:

$ touch $'\nbad_file'
$ rm $'\nbad*'
rm: cannot remove ''$'\n''bad*': No such file or directory

$ rm '
> bad*'
rm: cannot remove ''$'\n''bad*': No such file or directory



One part I won't retract is my contention that support for line feeds in file names is a bad idea.

In fact, if someone comes along and "oxidizes" (re-writes in Rust using mostly the same test suites) but ditches a bunch of this accumulated cruft, I'm all for it.


To unsubscribe send a blank message to linux+unsubscribe [ at ] linux-ottawa [ dot ] org
To get help send a blank message to linux+help [ at ] linux-ottawa [ dot ] org
To visit the archives: https://lists.linux-ottawa.org