Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
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:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- 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:
>
> Icon$'\r'
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 *
> do
> if [ "$i" != "Icon$'\r'" ]
> then
> echo "$i"
> fi
> done
$'\r' is already a form of quoting, just *don't* put it in double-quotes:
for i in *
do
if [[ "$i" != Icon$'\r' ]]
then
# whatever
fi
done
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:
Reverse Date,
Date,
Thread,
Author