Message-ID: <68158c22@news.ausics.net> From: Computer Nerd Kev Subject: Re: Case Insensitive File Systems -- Torvalds Hates Them Newsgroups: comp.os.linux.misc References: <20250428080014.0000347f@gmail.com> <20250428111242.00007426@gmail.com> <6813f997@news.ausics.net> <681471b1@news.ausics.net> <68154e05@news.ausics.net> User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/2.4.31 (i686)) NNTP-Posting-Host: news.ausics.net Date: 3 May 2025 13:23:14 +1000 Organization: Ausics - https://newsgroups.ausics.net Lines: 44 X-Complaints: abuse@ausics.net Path: ...!weretis.net!feeder9.news.weretis.net!news.bbs.nz!news.ausics.net!not-for-mail Bytes: 2772 Lawrence D'Oliveiro wrote: > On 3 May 2025 08:58:14 +1000, Computer Nerd Kev wrote: > >> Well now it's gone from the bad situation of confusing filename output >> to the worse situation of completely different output from different >> common command-line programs ... > > No, you just get different output options available in the same program, > namely GNU ls. And completely unstandardised between programs, even the defaults of the GNU versions of ls and find. So you never know how newlines in filenames will appear in any one program's output. The only good solution is if they're never there in the first place, but unfortunately they are allowed to be. I see this in GNU Find's documentation: "-print True; print the entire file name on the standard output, followed by a newline. If there is the faintest possibility that one of the files for which you are searching might contain a newline, you should use '-print0' instead." http://www.gnu.org/software/findutils/manual/html_node/find_html/Print-File-Name.html Seems that disables converting newlines to '?' and ends results with null instead. $ touch 'good?file' good$'\n'file $ find -print | cat -A ..$ ../good?file$ ../good$ file$ $ find -print0 | cat -A ..^@./good?file^@./good$ This describes how that's not always a solution. Which points out how awkward the whole issue of handling newlines in filenames is: http://www.gnu.org/software/findutils/manual/html_node/find_html/Newline-Handling.html -- __ __ #_ < |\| |< _#