Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: question mark in filename.
- X-seq: zsh-users 26368
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: question mark in filename.
- Date: Sun, 10 Jan 2021 07:03:34 -0800
- Archived-at: <https://zsh.org/users/26368>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-01/cae36dc7-6017-f9b8-730d-74f05e6c2a13%40eastlink.ca>
- In-reply-to: <CAN=4vMpjAzui04sEP5SsXDfqnJjF8Jt0Oir0qUsWzXAojy3snQ@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <d720a4ef-d2b6-51b4-d6a6-98b583338621@eastlink.ca> <CAN=4vMpjAzui04sEP5SsXDfqnJjF8Jt0Oir0qUsWzXAojy3snQ@mail.gmail.com>
On 2021-01-09 11:02 p.m., Roman Perepelitsa wrote:
My guess is that the name of this file contains something interesting
in place of question marks (ascii 63). Try this:
ls s,7* | cat -v
print -r -- s,7* | od -t x1 -An -v
Roman.
Right! I create a similar file:
$ touch s,8,big?improvements?in?code
$ ls s,8*
s,8,big?improvements?in?code
$ print -r -- s,7* | od -t x1 -An -v
73 2c 37 2c 62 69 67 0a 69 6d 70 72 6f 76 65 6d
65 6e 74 73 0a 69 6e 0a 63 6f 64 65 0a
$ print -r -- s,8* | od -t x1 -An -v
73 2c 38 2c 62 69 67 3f 69 6d 70 72 6f 76 65 6d
65 6e 74 73 3f 69 6e 3f 63 6f 64 65 0a
pasting the two outputs and trimming to the first question mark:
73 2c 37 2c 62 69 67 0a << A bleeding linefeed!
73 2c 38 2c 62 69 67 3f << A real question mark.
... which is exactly what tried to show when printing my '$output', it
broke on the 'question marks' that are really newlines anyway. So a
better question is why ls does this:
$ ls -1 s,[7,8]*
s,7,big?improvements?in?code
s,8,big?improvements?in?code
Anyway the former was auto generated by a utility I have and it was
clearly in a buggy state when it made that file. And now we know that
'ls' replaces linefeeds with question marks, thanks Richard Stallman.
Maybe any non-visible character? But then again 'eval' uses question
marks the first time and spaces the second so it's not just an issue
with 'ls'.
Nice call Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author