From owner-freebsd-questions@freebsd.org Fri Nov 1 03:07:35 2019 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E38FD1A1581 for ; Fri, 1 Nov 2019 03:07:35 +0000 (UTC) (envelope-from thor@irk.ru) Received: from mail.irk.ru (relay2.dsi.ru [195.206.40.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4746Yx3tWMz4CNF for ; Fri, 1 Nov 2019 03:07:33 +0000 (UTC) (envelope-from thor@irk.ru) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=irk.ru; s=dkim; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version: Date:Message-ID:From:References:To:Subject; bh=D2KIXQRJmHF9K2PykiyzwrupNMHayVeUI/wTYFp7QxA=; b=XrTl8Ge3OqKpDEjLMK9wxNX/bZ Y6KGz91tpMxfo4RI/sB5X3A4Gbl7g1kDaW4c98cVhddK9c52JHy+S5Xvlfl6OkfH49E8eguSUnvZo Ly8TrKP3bP4bYQYS/bMb0NrdEoFOKk5QV/zqG5639tMPvJoC9iH6QRerNto/9sXWmE8M=; Received: from [194.176.114.54] (helo=[192.168.1.130]) by mail.irk.ru with esmtpa (Exim 4.86 (FreeBSD)) (envelope-from ) id 1iQN5p-000JiO-Mw for freebsd-questions@freebsd.org; Fri, 01 Nov 2019 10:55:17 +0800 Subject: Re: grep for ascii nul To: freebsd-questions@freebsd.org References: <20191101024817.GA60134@admin.sibptus.ru> From: thor Message-ID: <2c08387c-425b-060d-4f9b-3443a3f6a18f@irk.ru> Date: Fri, 1 Nov 2019 11:07:29 +0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20191101024817.GA60134@admin.sibptus.ru> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 4746Yx3tWMz4CNF X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=irk.ru header.s=dkim header.b=XrTl8Ge3; dmarc=pass (policy=none) header.from=irk.ru; spf=pass (mx1.freebsd.org: domain of thor@irk.ru designates 195.206.40.175 as permitted sender) smtp.mailfrom=thor@irk.ru X-Spamd-Result: default: False [-0.30 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[irk.ru:s=dkim]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-0.94)[-0.938,0]; NEURAL_SPAM_MEDIUM(0.09)[0.086,0]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(1.55)[ipnet: 195.206.32.0/19(4.31), asn: 8345(3.45), country: RU(0.01)]; DKIM_TRACE(0.00)[irk.ru:+]; DMARC_POLICY_ALLOW(-0.50)[irk.ru,none]; RCVD_IN_DNSWL_NONE(0.00)[175.40.206.195.list.dnswl.org : 127.0.10.0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:8345, ipnet:195.206.32.0/19, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Nov 2019 03:07:35 -0000 There is NO such thing as filenames containing 0x00 inside the filename. UNIX filenames are strings in C meaning and may contain any 8-bit values except "/" which delimits the subdirectory names and 0x00 which marks the end of filename string. At least it was so when I first met Unix, and I hope Bill Gates never influenced Unix since this time. On 11/01/19 10:48, Victor Sudakov wrote: > Dear Colleagues, > > How can I print the names of files containing ascii nul (\x0)? The > FreeBSD "grep -l" does not seem to be able to do it. > > NB I don't need to delete the nul character with sed or tr, just need to > find files containing it. >