From nobody Fri Feb 03 14:18:53 2023 X-Original-To: freebsd-stable@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 4P7d524zsJz2pB46 for ; Fri, 3 Feb 2023 14:16:54 +0000 (UTC) (envelope-from eivinde@terraplane.org) Received: from smtp.domeneshop.no (smtp.domeneshop.no [IPv6:2a01:5b40:0:3006::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4P7d522xxqz4FMl for ; Fri, 3 Feb 2023 14:16:54 +0000 (UTC) (envelope-from eivinde@terraplane.org) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=terraplane.org; s=ds202212; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=IDC4SfW5FltmujHwWrIhcumj0FZz2ZbDdLL7b/hRzxo=; b=qH11hawjcD6mgQONpHEmrXdIfn UA2lGSQUyXbAjkcs3O08G2p5o0szZrn7D2e5xxnJxDQFvScOFFCMSvnTck3WU3MBW8E5+saZjG8ge nRF6SMV/5aNP67HwFa5H3ZF1qn2RloboWYUdQomjNRygoKcsB012A8J5Etr865ArcWGfy/EX8f3cD tsSBWm0Adn8GASuT4gvv2P7H3pScO8HzftgtRaYl2GkuK0w0REEpiWCkQ2CWmuU2gzJzfEm1g+Ap1 agOILQOJPZX4xn7p8wRKZZqesI4au34ihp0fdjjCzahQNvQPS+28aD5j+uBbHThmobHVXceZoJO/H 8lKyaHPg==; Received: from ti0027q160-0136.bb.online.no ([37.200.21.137]:26186 helo=elg.hjerdalen.lokalnett) by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pNwry-003Q4C-53; Fri, 03 Feb 2023 15:16:50 +0100 Date: Fri, 3 Feb 2023 15:18:53 +0100 From: Eivind Nicolay Evensen To: Eugene Grosbein Cc: freebsd-stable@freebsd.org Subject: Re: Grep with non-ascii Message-ID: <20230203151853.02732bd6@elg.hjerdalen.lokalnett> In-Reply-To: <819a4336-9689-bdbe-a90d-8f1d7b842662@grosbein.net> References: <20230203110642.70e4a076@elg.hjerdalen.lokalnett> <819a4336-9689-bdbe-a90d-8f1d7b842662@grosbein.net> List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4P7d522xxqz4FMl X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:12996, ipnet:2a01:5b40::/48, country:NO] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N Den Fri, 3 Feb 2023 19:12:32 +0700 skrev Eugene Grosbein : > 03.02.2023 17:06, Eivind Nicolay Evensen wrote: > > Hello. > > > > I just noticed this today: > > > > elg!ene[~]> printf "bø\nhei\nøl\n" | grep ø > > grep: trailing backslash (\) > > elg!ene[~]> echo $LC_CTYPE $LANG > > nb_NO.ISO8859-1 nb_NO.ISO8859-1 > > > > While I have the result I envisioned with gnugrep: > > > > elg!ene[~]> printf "bø\nhei\nøl\n" | ggrep ø > > bø > > øl > > > > Also, on OpenIndiana, linux and Netbsd, grep gives the proper > > result. > > > > Is lib/libc/regex the right place to look into this if I > > find the time, or does anybody know this enough to know the > > problem? > > Try single quotes instead of double quotes. > And pleace specify system version and shell name, and shell version > if its not in base system. This is elg!ene[~]> uname -a FreeBSD elg.hjerdalen.lokalnett 13.2-PRERELEASE FreeBSD 13.2-PRERELEASE #1: Tue Jan 31 11:23:29 CET 2023 ene@elg.hjerdalen.lokalnett:/usr/obj/usr/src/amd64.amd64/sys/ENE-spurv amd64 Using the tcsh that comes with it. But I don't think the quotes matter much because of this: elg!ene[~]> grep ø grep: trailing backslash (\) The output was more just to have something to look for, like with ggrep but anyway: elg!ene[~]> printf 'bø\nhei\nøl\n' |grep ø grep: trailing backslash (\) And obviously: elg!ene[~]> printf 'bø\nhei\nøl\n' bø hei øl And it seems to be the same for any 8859-1 character not part of ascii: elg!ene[~]> grep ä grep: trailing backslash (\) elg!ene[~]> grep ß grep: trailing backslash (\) elg!ene[~]> grep ç grep: trailing backslash (\) -- Eivind Nicolay Evensen