From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 29149 invoked from network); 21 Oct 2021 13:09:41 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Oct 2021 13:09:41 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1634821781; b=XkSNsiBoE8qXYq2tx29fI5exut+ALtmjN3LFQsduHzGmJAixm6xHUPgywJO5OEClAsJYAo8+s5 CxgOPWH2n2nH5GUMjc/qRBCXTJ7Gf2OrghSj7M6eS0iHTSD66Om8KE2pwrlHmVZ7mRUIPni02U j3vXsM3UxT5OLSkfC5X+PN6lSso23qhknRrEhX3Zdmi6VFFYLIMa7upknkXvTjPY+7M16daabv 93utjLIzYYLxKzIn+h8f/oCxKl5u/iW4GCYj/RKFNf9B9iuqZ+RuGA6QIXhA8hpqBGVc0qZpqg 5umhwiv3Mav72+WDhff1QpjiyK01aoJU6pibAgK/rrtkpA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpq2.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.97; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1634821781; bh=Q7pQohHwi/FG9TAmndVDx2uhh3tLyPlal0BIPp1zwtw=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject: References:In-Reply-To:Message-ID:To:From:Date:DKIM-Signature: DKIM-Signature; b=b++HDsobS7ybwhWvd4NN4BanTOOWe29JFXgDKPUceBA6fCEFGkdSU+V0d4m721FKzvw+U7o4qk Mz84ko9MTXLV7IdWWukRzypQouH9Ukxi96r+WsLQh0tknsLq5MKAqDXhs7/jKXLJWi7dqlD/vG r9lqg2I3ROKwdy20E/vBlG/uzy+Wa571jofKl2wuBwYp+Wxk2BtL8f0Wh/8SebRgoe8qCRbuEH CMMtR4kX2ApZQWFbWr5Qktr0pu0mJ4qEcYU19Vn+HE28z0HjK7DTAxMUjfnKOdZOcOgEUZr8Mn IEELVzHET0+qEMnHiq6V95Hy/wS1Bup+kLiiwkyyOZdCxA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID:To:From: Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=WgGQvFUHNsncxg/cNQkOXTmL6oSS0xf+1T4iLAAJCao=; b=YmPdA0I4gRAyZTojyELsvRtDx7 5iZZKcebo2CXlHRiJfTZUH2I67MO+Sb8MdpEzYpk5kkXo3bPTOZ9usOwQeKqdiKA3FpQZ/QQkWNGd fpFc+mTBYpg3R7oRvFqfE23n0tUy2RyfvHlTOww+lql7GJQGY4dn4v/iK7yzutpi7+oSFsl4M+Clc iL3VSfM0bRZB9eKVitE29NEeAIqVyEdwuUGBbiX3pZlL3CoBTJiBczERC9uRnXQHTAeZ7pdA8TzsN JP3hI5f/T8MEbuiJFqPl7BP6kO5e0ODlqcJHvwl93SJOlyR8TRtvzbIIkh3l87N3PT8c9/Ppbl5rE JSzPjypg==; Received: from authenticated user by zero.zsh.org with local id 1mdXpD-0004sW-Vc; Thu, 21 Oct 2021 13:09:39 +0000 Authentication-Results: zsh.org; iprev=pass (smtpq2.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.97; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from smtpq2.tb.ukmail.iss.as9143.net ([212.54.57.97]:33476) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1mdXoH-0004C4-V3; Thu, 21 Oct 2021 13:08:43 +0000 Received: from [212.54.57.82] (helo=smtp3.tb.ukmail.iss.as9143.net) by smtpq2.tb.ukmail.iss.as9143.net with esmtp (Exim 4.90_1) (envelope-from ) id 1mdXoH-00069Y-Nw for zsh-users@zsh.org; Thu, 21 Oct 2021 15:08:41 +0200 Received: from oxbe8.tb.ukmail.iss.as9143.net ([172.25.160.139]) by smtp3.tb.ukmail.iss.as9143.net with ESMTP id dXoHmlIJlAhO0dXoHmIYYM; Thu, 21 Oct 2021 15:08:41 +0200 X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-users@zsh.org X-SourceIP: 172.25.160.139 X-CNFS-Analysis: v=2.4 cv=BpWOfKb5 c=1 sm=1 tr=0 ts=61716659 cx=a_exe a=pgSR3NrKiwmx/6vnWRL19w==:117 a=JHxdR_ueUdoA:10 a=IkcTkHD0fZMA:10 a=pfAyaZmUD_0A:10 a=pGLkceISAAAA:8 a=VxGRtt3Xtbq9yrCPe0oA:9 a=QEXdDO2ut3YA:10 X-Authenticated-Sender: p.w.stephenson@ntlworld.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntlworld.com; s=meg.feb2017; t=1634821721; bh=Q7pQohHwi/FG9TAmndVDx2uhh3tLyPlal0BIPp1zwtw=; h=Date:From:To:In-Reply-To:References:Subject; b=f2Xrunmiosz1EZDfasb+eS0IpPcYWs8qbbtI6vDO6q0bkGodns547VSKg35k2mx06 rG3I4404o94OkzvKWsCObV8Ygq/4bnJ+uOioFmv/BEYnMRh0+LD567hA56t0jVe6vh Z1P62ka9yu2HNDGQ81l2oLnkTC8MruLBjhWFzySXqhLWQYJtyQ2PIcSCJ8BHZ4ie3k ZCs5+dFtFQj46CaROeUenbz+Alq43q9c3rWvdCn2SG9YfSoz0GrYZN4+OijlfOkHPo I+NAXV2iascb+dwQcOrU2Uvy16lIR0xyR1y7KYJtEh44UMIu8u++7AboLXeyspx/sX VYwAyA+hUxFVw== Date: Thu, 21 Oct 2021 14:08:41 +0100 (BST) From: Peter Stephenson To: Pier Paolo Grassi , Zsh-Users List Message-ID: <899710302.733700.1634821721465@mail2.virginmedia.com> In-Reply-To: References: Subject: Re: read string containing null MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev72 X-Originating-IP: 165.225.81.18 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfIwYBtEnn8xaiferwSfdDgdVHw6zcBjg8wH7K/fD/IMl5iq/taY/k3aE7FLHQGjKnOSoMnS0LFrRaSAka+roABDSkFhu8H0fGsmeb8gJT291Y9DUyka0 3GmbniqNCnc9L4/yotY2bivtv9uLc5ac5j6b1F+E0SdkG10BtZnx+Nv4mdWDQgKfiubTdRO32NYEBqHqbAp84A4Zq4eGs8SeAJZMwWkQWTXb7Sr2p+slWpcs NHAS26ky1Eq8JD3JlYCafQ== X-Seq: 27255 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: > On 21 October 2021 at 13:35 Pier Paolo Grassi wrote: > Hello, I just found out: > > echo -e - a$'\000'b | IFS='' builtin read -r -d '' xx; echo -n - $xx > result is "a" > > is it possible for builtin read not to stop an null bytes? I found nothing > in documentation. > thanks I think -d '' is telling it to treat NULL bytes as a delimiter. Take that out. If you're not trying to read a line, don't use read. If you "zmodload zsh/system" there's a sysread command which is more useful for lower level operations. pws