From owner-freebsd-questions@freebsd.org Fri Nov 1 09:47:21 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 E3EA01AF036 for ; Fri, 1 Nov 2019 09:47:21 +0000 (UTC) (envelope-from michaelsprivate@gmail.com) Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474HRD0WDzz412S for ; Fri, 1 Nov 2019 09:47:19 +0000 (UTC) (envelope-from michaelsprivate@gmail.com) Received: by mail-qk1-x741.google.com with SMTP id q70so10024882qke.12 for ; Fri, 01 Nov 2019 02:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=U8gRcLApSWCldXtIPFzccAJYZLLBZNHWawL/1EKzsx8=; b=O2GfS7xtRlG8dmLzleJr/Bq1Apv3Fu0UwIPZvrMBUMKgy+GpetLFWYs8ndcuuWK4UQ 2/LOGJXRfvmzzlCMNchsctQOlh1u1g6o7T+UkrQNX+QjD4PxZxVPFPbV+fmXGXuYGn1s jRbf9cUboWSqexpT5o9qc4hGK6wid/+kBIr89siusadgrf9jeczH4yecOyXfSV/MalrI n0wJU4kbDUgpZaSscJAqZ0YNFgMYj5jvn9f5BU95lZzYo2iRwo0FEcXcgikWkwUbAx3p LG3ThXqPnPCXb7x4ukw6sTeS8pNPfx1px1O3RlJLTkHhOZcXGhJWUGzZxOcZ6/Hbqf2K vC+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=U8gRcLApSWCldXtIPFzccAJYZLLBZNHWawL/1EKzsx8=; b=plHjHCUdaeDrrOOQ+PD/a8eBBkbUSl7x6YwAPVxJ95AruNYYILM2G/z9+ANIaI9p5a T5SVFXa3EhJCrIFiTmnGC7zyYA+zjgLfC9F6afIFMJfI014Sy9yq16NJlw/+pksUzxJy LY6+o8zeypRaFtKenthtbtC1J/7G5K6QbAyvqug8ncEXD7kDl1m5TQrZz+SybytUJDvB HJ1WjJUme4gAJ4kqZ8B1ZbdWLg8Oi/yHHQRzBTEgM3hADqvSRjwdciKAs+I4fhALdVm8 6ZYZO0eiIBoUaucymlSPcovHR7gq17Vx93fumy+dOLl1N0HvUj5KhV94aPe8ndKxfEZC 0iSw== X-Gm-Message-State: APjAAAXvEkWyWjU3tCRqEYqxBFDKpWPa03mJfvQCUCMJFevCymilbwbf EKZ5J6x09T/ml+GE1e4GKncrXd7u+sVHGfFL8NnYIA== X-Google-Smtp-Source: APXvYqykZC/vVUmvDfLN0POkEsn5Zi1xSP7ErmM0Yk2G4VJXXYau9Sxqe7dpvvj1k6xtFcj6ivmh1NjU8B9/rF615eg= X-Received: by 2002:a05:620a:527:: with SMTP id h7mr9367677qkh.322.1572601638784; Fri, 01 Nov 2019 02:47:18 -0700 (PDT) MIME-Version: 1.0 References: <20191101024817.GA60134@admin.sibptus.ru> <2c08387c-425b-060d-4f9b-3443a3f6a18f@irk.ru> <20191101092716.GA67658@admin.sibptus.ru> In-Reply-To: <20191101092716.GA67658@admin.sibptus.ru> From: Michael Schuster Date: Fri, 1 Nov 2019 10:47:07 +0100 Message-ID: Subject: Re: grep for ascii nul To: Victor Sudakov Cc: freeBSD Mailing List X-Rspamd-Queue-Id: 474HRD0WDzz412S X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=O2GfS7xt; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of michaelsprivate@gmail.com designates 2607:f8b0:4864:20::741 as permitted sender) smtp.mailfrom=michaelsprivate@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; URI_COUNT_ODD(1.00)[9]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[1.4.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; IP_SCORE(0.00)[ip: (2.52), ipnet: 2607:f8b0::/32(-2.39), asn: 15169(-2.04), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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 09:47:21 -0000 https://stackoverflow.com/questions/4180081/binary-grep-on-linux/4180531#4180531 Does that help? On Fri, Nov 1, 2019, 10:29 Victor Sudakov wrote: > Sorry for the confusion. Of cource I meant files with ascii nul in file > contents, inside. Because why would I have mentioned "grep"? > > I need to find files containing ascii null inside, and print their names > to stdout. > > > thor wrote: > > 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. > > > > > > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" > > -- > Victor Sudakov, VAS4-RIPE, VAS47-RIPN > 2:5005/49@fidonet http://vas.tomsk.ru/ >