From nobody Sat Mar 09 17:55:34 2024 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TsW0s2589z5Df28 for ; Sat, 9 Mar 2024 17:55:41 +0000 (UTC) (envelope-from dhenin@gmail.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TsW0r6prhz47xV for ; Sat, 9 Mar 2024 17:55:40 +0000 (UTC) (envelope-from dhenin@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-42f0aa61b67so21971781cf.1 for ; Sat, 09 Mar 2024 09:55:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710006939; x=1710611739; darn=freebsd.org; h=mime-version:date:message-id:subject:cc:to:from:delivered-to :references:in-reply-to:from:to:cc:subject:date:message-id:reply-to; bh=2M3yf0lwgyyrggm9Vt1rvr4dd+QJUo+zPOlBYPUw3+0=; b=Aw53sRbgOuyDXnTTkR9F1aexdwWhNtldhpqSylvOINBfj9WDPqY0bekIAbs3r6nKro crHWFr++Osw6vkJDtWDLdjOiG4HVLxhtTvuMq0N4grxRmJ10WeTXDbgGtZHDo1BMPjmO cLt4Qfw2s0g9FdjZ+cAi4ngufw3SzrbLeJkQArd411UlvjUYrLHUeRBWXKnmUlY3JI5U blaWueE0CjG1Bp3J63H0bBM7z0IN/KNj4dLIFro1a7rbaVz+PXayHxNBZAwsQTsxFups cO8d3KEyWEMDB5ZyMvpnztT7FOCmOwPkGNMZcN6FSHN5cuW+L0YNhmYOVfzvI5heDLUQ b5SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710006939; x=1710611739; h=mime-version:date:message-id:subject:cc:to:from:delivered-to :references:in-reply-to:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2M3yf0lwgyyrggm9Vt1rvr4dd+QJUo+zPOlBYPUw3+0=; b=uKAGHv2Te3oiacefyqL1WhTSFX9GPuqa8VbZJRSvcvdZzvdMIf6AIAyFqcUfHF7Khv Yw3FC1XaPdgfJCwihzOWsomTln0cakqfmjTT7ykP8Xh6KEwDxQmiIrkVEhFGg39+37Sg D7d5FsnsuhTs3EgE3diYV3YRyho2UNAzMqwvFJU/boLF7z5JWniyuxYfmrfAc+dIrezI C/pEdiYLBe7HSUzAgZwmHoEWu6P54qXvnO3ysY/kvYCW1WiK2wLL9oki0duB4jiG/cUb mLohve5skc82UxK/wP9b/ElJ54ugE4o08c3cKGDvqmCqL0+MEGiyacEWTy8Siyf4DaLB HQ0w== X-Gm-Message-State: AOJu0Yy5id7iSoB3HvNRWH29T8tdocWfAOfOZvcbx5QdlNr3Qw/6jcBX fQPpW56VvMR/lTxFgHLYQnOk8tvgTYXH3RI/YSIHwbsb5fBHcU/ptmuSD6m1 X-Google-Smtp-Source: AGHT+IGrd8QzpntWDZ6p+MubeuTNe/HgU+//8zqEGW8kE2LN9BG4YysWSjklmR52A3JE0DkGXO45dg== X-Received: by 2002:ac8:5783:0:b0:42e:f8d9:69e7 with SMTP id v3-20020ac85783000000b0042ef8d969e7mr3188055qta.2.1710006938593; Sat, 09 Mar 2024 09:55:38 -0800 (PST) Received: from send-12.prod.mixmax-mailer.com (send-12.prod.mixmax-mailer.com. [52.200.39.124]) by smtp.gmail.com with ESMTPSA id z22-20020ac84556000000b0042eddd43a72sm1110211qtn.84.2024.03.09.09.55.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Mar 2024 09:55:38 -0800 (PST) Content-Type: multipart/alternative; boundary="--_NmP-a10823fa44109986-Part_1" In-Reply-To: <50b7db9d-0829-4db2-9bc4-c8e84b54060b@FreeBSD.org> References: <50b7db9d-0829-4db2-9bc4-c8e84b54060b@FreeBSD.org> Delivered-To: rsm@mixmax.com From: =?UTF-8?Q?=CF=86__Dh=C3=A9nin_Jean-Jacques?= To: Kyle Evans Cc: questions@freebsd.org Subject: Re: 'ls' name and 'ls | grep name' different Message-ID: Date: Sat, 09 Mar 2024 17:55:34 +0000 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4TsW0r6prhz47xV ----_NmP-a10823fa44109986-Part_1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable et voila=C2=A0::; ls 1989*1989 Amn=C3=A9sia.mp4:; LANG=3Dfr_FR.UTF-8:; ls = 1989*1989 Amn??sia.mp4 Le=C2=A0sam. 9 mars 2024 =C3=A0=C2=A017:41, Kyle = Evans a =C3=A9crit=C2=A0: On 3/9/24 10:37, Michael = Sierchio wrote: >=20 >=20 > On Sat, Mar 9, 2024 at 11:19 AM =CF=86 = Dh=C3=A9nin Jean-Jacques >= wrote: >=20 >=C2=A0 =C2=A0 =C2=A0Bonjour, >=20 >=C2=A0 =C2=A0 =C2=A0I = explain=C2=A0 it as simple as possible: >=20 >=C2=A0 =C2=A0 =C2=A0:; = =C2=A0set | egrep 'LC_A|LANG' >=C2=A0 =C2=A0 =C2=A0GDM_LANG=3Dfr_FR.UTF-8 >=C2=A0 =C2=A0 =C2=A0LANG=3Dfr_FR.UTF-8 >=C2=A0 =C2=A0 =C2=A0LC_ALL=3Dfr_FR= .UTF-8 >=C2=A0 =C2=A0 =C2=A0SLIM_LANG=3Dfr_FR.UTF-8 >=20 >=C2=A0 =C2=A0 =C2=A0:; =C2=A0ls -i =C2=A01989* ; ls -i | grep 1989 ; = =C2=A0ls -ib =C2=A01989* ; ls -ib | >=C2=A0 =C2=A0 =C2=A0grep 1989 >=C2=A0 =C2=A0 =C2=A09920 1989 Amn*??*sia.mp4 >=C2=A0 =C2=A0 =C2=A0 = =C2=A09920 1989 Amn*=C3=A9*sia.mp4 >=C2=A0 =C2=A0 =C2=A09920 1989 = Amn\303\251sia.mp4 >=C2=A0 =C2=A0 =C2=A0 =C2=A09920 1989 Amn\303\251sia.mp4 >=20 >=20 > Bonjour J-J =E2=80=93 >=20 > It's not that the pipe modifies = the stream, it's that 'ls' has decided=20 > that 'e-accent-aigu' is = unprintable in the current locale. >=20 > Try ls -B and then investigate = the locale. >=20 > *-B*=C2=A0 =C2=A0 =C2=A0 =C2=A0Force=C2=A0 = printing=C2=A0 =C2=A0 of=C2=A0 non-printable=C2=A0 characters=C2=A0 = (as=C2=A0 defined by >=C2=A0 =C2=A0 =C2=A0 =C2=A0/ctype/(3)=C2=A0 < https://man.freebsd.org/cgi/man.cgi?query=3Dctype&sektion=3D3&a propos=3D0&manpath=3DFreeBSD+14.0-RELEASE+and+Ports>=C2=A0 =C2=A0 =C2=A0 = =C2=A0 and current locale settings) in file=C2=A0 names=C2=A0 as *\*/xxx/, >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 where/xxx/=C2=A0 is = the=C2=A0 =C2=A0 =C2=A0 =C2=A0numeric value of the character in octal.=C2=A0 This >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 option = is not defined in IEEE Std 1003.1-2008 ("POSIX.1") >=20 ls(1) notably does toggle this behavior on by default only if stdout is=20 a tty requiring the above noted flag, and leaves it disabled if it's = piping: https://cgit.freebsd.org/src/tree/bin/ls/ls.c#n241 This gives grep the chance to just let it render. Thanks, Kyle Evans -- ---------------------------------------------------------=F0=9F=93=9E 06 89= 66 51 35 (V)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Dh=C3=A9nin Jean-Jacques ( ..)=C2=A0=C2=A0=C2=A0=C2=A0 48, rue de la Justice 78300 Poissy c(')(')=C2=A0 dhenin@gmail.com --------------------------------------------= ------------- ----_NmP-a10823fa44109986-Part_1 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

et voila=C2=A0:=C2=A0
:; ls 1989*
1989 Amn=C3=A9sia.mp4
:; = LANG=3Dfr_FR.UTF-8
:; ls 1989*
1989 Amn??sia.= mp4



Le=C2=A0sam. 9 = mars 2024 =C3=A0=C2=A017:41, Kyle Evans <kevans@freebsd.org> a = =C3=A9crit=C2=A0:
On 3/9/24 10:37, Michael Sierchio wrote:
> =
>
> On Sat, Mar 9, 2024 at 11:19 AM =CF=86 Dh=C3=A9nin = Jean-Jacques <dhenin@gmail.com
> <mailto:dhenin@gmail.= com>> wrote:
>
>=C2=A0 =C2=A0 =C2=A0Bonjour,
= >
>=C2=A0 =C2=A0 =C2=A0I explain=C2=A0 it as simple as = possible:
>
>=C2=A0 =C2=A0 =C2=A0:; =C2=A0set | egrep = 'LC_A|LANG'
>=C2=A0 =C2=A0 =C2=A0GDM_LANG=3Dfr_FR.UTF-8
= >=C2=A0 =C2=A0 =C2=A0LANG=3Dfr_FR.UTF-8
>=C2=A0 =C2=A0 = =C2=A0LC_ALL=3Dfr_FR.UTF-8
>=C2=A0 =C2=A0 =C2=A0SLIM_LANG=3Dfr_FR.= UTF-8
>
>=C2=A0 =C2=A0 =C2=A0:; =C2=A0ls -i =C2=A01989* ; ls= -i | grep 1989 ; =C2=A0ls -ib =C2=A01989* ; ls -ib |
>=C2=A0 =C2=A0= =C2=A0grep 1989
>=C2=A0 =C2=A0 =C2=A09920 1989 Amn*??*sia.mp4
= >=C2=A0 =C2=A0 =C2=A0 =C2=A09920 1989 Amn*=C3=A9*sia.mp4
>=C2=A0 = =C2=A0 =C2=A09920 1989 Amn\303\251sia.mp4
>=C2=A0 =C2=A0 =C2=A0 = =C2=A09920 1989 Amn\303\251sia.mp4
>
>
> Bonjour J-J= =E2=80=93
>
> It's not that the pipe modifies the stream, = it's that 'ls' has decided
> that 'e-accent-aigu' is unprintable in= the current locale.
>
> Try ls -B and then investigate the = locale.
>
> *-B*=C2=A0 =C2=A0 =C2=A0 =C2=A0Force=C2=A0 = printing=C2=A0 =C2=A0 of=C2=A0 non-printable=C2=A0 characters=C2=A0 = (as=C2=A0 defined by
>=C2=A0 =C2=A0 =C2=A0 =C2=A0/ctype/(3)=C2=A0 = <https://man.freebsd.org/cgi/man.= cgi?query=3Dctype&sektion=3D3&apropos=3D0&manpath=3DFreeBS= D+14.0-RELEASE+and+Ports>=C2=A0 =C2=A0 =C2=A0 =C2=A0 and = current locale settings) in file=C2=A0 names=C2=A0 as *\*/xxx/,
= >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 where/xxx/=C2=A0 is = the=C2=A0 =C2=A0 =C2=A0 =C2=A0numeric value of the character in octal.= =C2=A0 This
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 option= is not defined in IEEE Std 1003.1-2008 ("POSIX.1")
>
=
ls(1) notably does toggle this behavior on by default only if stdout = is
a tty requiring the above noted flag, and leaves it disabled if = it's piping:

https:/= /cgit.freebsd.org/src/tree/bin/ls/ls.c#n241

This gives = grep the chance to just let it render.

Thanks,

Kyle = Evans


--
---------------------------------------------------------<= /div>
=F0=9F=93=9E 06 89 66 51 35
(V)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = Dh=C3=A9nin Jean-Jacques
( ..)=C2=A0=C2=A0=C2=A0=C2=A0 48, rue de la = Justice 78300 Poissy
c(')(')=C2=A0 dhenin@gmail.com
--------------------------= -------------------------------
3D""=20 ----_NmP-a10823fa44109986-Part_1--