Zsh Mailing List Archive
Messages sorted by:
Re: how to either ignore or deal with Icon$'\r' files on macOS
- X-seq: zsh-users 23977
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: TJ Luoma <luomat@xxxxxxxxx>
- Subject: Re: how to either ignore or deal with Icon$'\r' files on macOS
- Date: Thu, 20 Jun 2019 18:38:23 -0700
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=58bqoJjIg5GnzpYeTHadQzeZmbcvzLnfCPFPk0f7AwE=; b=ugB+dJ/XsrlS0qhh8v8P/PgETz7wngrKxBNUCkFqXhCI6Ilc1+xucBP4cLPc0s0o8c ANxyipqLEuo1w7KpXkAt/47Xu+T80nncckUWgY+hfYkmHwNhyWbWkfjCwpYvdDhwcXVe AgLMvqb4IF5/iCj4AMn6gLtMVuwCRZR0DF2kwqPyoGNQiXAK6SWLm0IMMQFHxvGHaDpF eGhdvryh3pykLS1z6tkW8N8Oy8tGvKi6yELJKED50VMxQTfnmBBjIQuEkcJwq0sB9O00 gqtbVzdEz/7b2RWUQNN8FrbHhKC04VYnkQskaozZONaxoyhQ7FJewmScAI1gEsXn89F0 c0BQ==
- In-reply-to: <CADjGqHt0p7Mohed9Ge80HidT93Q5Mc-DuKdKuzd-vrVGyMmQSQ@mail.gmail.com>
- List-help: <mailto:email@example.com>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- List-unsubscribe: <mailto:email@example.com>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CADjGqHt0p7Mohed9Ge80HidT93Q5Mc-DuKdKuzd-vrVGyMmQSQ@mail.gmail.com>
On Thu, Jun 20, 2019 at 5:06 PM TJ Luoma <luomat@xxxxxxxxx> wrote:
So, $'\r' is zsh's representation of a carriage return character.
It's very strange that anything would deliberately be using
carriage-return in a file name, but ...
> for i in *
> if [ "$i" != "Icon$'\r'" ]
> echo "$i"
$'\r' is already a form of quoting, just *don't* put it in double-quotes:
for i in *
if [[ "$i" != Icon$'\r' ]]
You should know better by now than to expect echo to faithfully
reproduce things on its output, it does way too much interpretation of
the argument strings. In this case, however, the trailing
carriage-return is already "invisible" and echo isn't going to do
anything to make it appear.
Messages sorted by: