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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13105 invoked from network); 19 Jan 2022 20:57:43 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 19 Jan 2022 20:57:43 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1642625863; b=cnYWZbM2eKkn11o5VSYac13bRvJoXjIWgCAfngUqfWYE8ObQ+kZHer67083lZEMnRMmtDJ8A8w 14hGfQ/PxqqMZjHGkC1I/KYMALo7FzaY4fHoUvo4o9oYFdxEgbeHqekj7Xg6qa1RhIAY41TWPo MtJlXpoKPflciI4sRBr+2Yl5QwI9pKTc5sevxWx+kYGdwisGHUg2/objxOlai5vD65btOBPBuB s9LU58x6ep5Xrj351YHOvD0gw8zl98lYwoUkbAcqh8kPNQjQw5g/u/2e/3mVd0mAMyk0t/6zIr Az0bHmYIwUb4PLiWe9/O88oukLHDJZI4NYgabxvWv5gvTg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (p3plsmtp18-06-2.prod.phx3.secureserver.net) smtp.remote-ip=173.201.193.192; dmarc=none header.from=rayninfo.co.uk; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1642625863; bh=1RWGiHgkslKO209IooD4R8E6Xd8CKMXUkBcsscvmRxw=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:MIME-Version:Date:Message-ID:Subject:From:To: DKIM-Signature; b=bp0KPtVIAYawu3ZsVYMsCBaaY2X5ZSblchkMqTyWH3Dysxzz7BhpYQEoyWHyiGbEtVgjLuPmSH GELEAy1W2TEOPHL9ShBWxr3NH0dX7ZhXNtEvgJYtffPAqQQ8AzlYYRuhRz6kSPRzo613FDwmh8 e0feIR2M4jwLc8+/WwwU4REv0wf61SPFnziQQ4JkJ0r8wTuoHJhN0mIM0qXvWjSAPpO1oebme2 nxNg6o0SU1Bw/WcDHkQEcpNsSbWXiLLJchRcpLS0/nfyIiqvoyo8kHGXqtFNS05ZCFnawifD12 qSguSuinduk5eLvSmSP9WxuyopG7zz+vuhe6ppkRyiZbYw==; 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-Type:MIME-Version:Date: Message-ID:Subject:From:To:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=7lO5TOCNoXztEKChpN8gK5c+HT6WeRlBuCWzw1R/fa8=; b=BtMhjW2VqQRdovahVQ0nU3905v YyPqzN3eb5e0pambCnEfyii0b2HTMGsaVW4gBD0v144aj5Pq2Vjjlrj1r9JVnfrM4APo1OcQZYe0p 3MsWy0FPK6RFisnArb90dQoJhBDIwPZUIr1/Q7VAx3PJOkYj1mUwBy08EPy/HwZVTzNMImIOmmDyj vbZFnrA0hw/8FmNI5Whnh8GVzayT2V2+d4Z78/IWrNs1guFJUU6ctaAJ52JY3WDh4nnePQU75kHEG QgA8Nt75nFRx8VKHp2PgpbIXXp58qF71w+S9UTHu11n7kflFI08XdEJkO7ndyg0pLEovEZd/xAmBP 8HQ1etTg==; Received: from authenticated user by zero.zsh.org with local id 1nAI1V-0005dn-GW; Wed, 19 Jan 2022 20:57:41 +0000 Authentication-Results: zsh.org; iprev=pass (p3plsmtp18-06-2.prod.phx3.secureserver.net) smtp.remote-ip=173.201.193.192; dmarc=none header.from=rayninfo.co.uk; arc=none Received: from p3plsmtp18-06-2.prod.phx3.secureserver.net ([173.201.193.192]:48930 helo=p3plwbeout18-06.prod.phx3.secureserver.net) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1nAI0h-0004vC-2O; Wed, 19 Jan 2022 20:56:52 +0000 Received: from mailex.mailcore.me ([94.136.40.144]) by :WBEOUT: with ESMTP id AI0dn4JT6gFtmAI0enhoNK; Wed, 19 Jan 2022 13:56:48 -0700 X-CMAE-Analysis: v=2.4 cv=MoKXV0We c=1 sm=1 tr=0 ts=61e87b10 a=wXHyRMViKMYRd//SnbHIqA==:117 a=rHK2uOEMTiGEVrMVgQVkrw==:17 a=ROY0Z9P4n60A:10 a=DghFqjY3_ZEA:10 a=r77TgQKjGQsHNAKrUKIA:9 a=shR4s0y3T52fCM5-t4wA:9 a=QEXdDO2ut3YA:10 a=YYpUXRv9HzgEUUo6WF4A:9 a=ljpItieo-viOifE8:21 a=_W_S_7VecoQA:10 X-SECURESERVER-ACCT: david@rayninfo.co.uk X-SID: AI0dn4JT6gFtm Received: from host86-183-76-238.range86-183.btcentralplus.com ([86.183.76.238] helo=[192.168.1.231]) by smtp12.mailcore.me with esmtpa (Exim 4.94.2) (envelope-from ) id 1nAI0d-0008IF-8E for zsh-users@zsh.org; Wed, 19 Jan 2022 20:56:47 +0000 To: Zsh-Users List From: zzapper Subject: zsh-ify a bash script Message-ID: <2e3d8557-9f6f-5d17-7517-7f9fcf7be1ce@rayninfo.co.uk> Date: Wed, 19 Jan 2022 20:56:46 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------A4A368B81D07CCF511E03A3E" Content-Language: en-US X-Mailcore-Auth: 8308408 X-Mailcore-Domain: 840527 X-123-reg-Authenticated: david@rayninfo.co.uk X-Originating-IP: 86.183.76.238 X-CMAE-Envelope: MS4xfKoQmeOJUCZNQFEhpkfyux1atN5IqA/IWnYCBfWP3CqRmnhbGSJyzLe8PXMpkSZj1iEuxmYziF+ch97tC8TaYgLhfCH5iOQVGyqqM/FI/d2RHJPuWhYk QZgsi4Z9A6uFIUz8SkzgCHGJRXr/4dLQClHRqYSG0MCI4/uMw+1W0vhM2n8enrOkgXXieVF2ZYPUDA== X-Seq: 27477 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: This is a multi-part message in MIME format. --------------A4A368B81D07CCF511E03A3E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit hi By Tim chase Dumb CLI trick. Wanted to find files containing all of several terms (dup2, pledge, socketpair, fork), but they could occur anywhere in the file: $ find . -name '*.c' | xargs fgrep -lw dup2 |xargs fgrep -lw pledge | xargs grep -l 'socketpair.*SOCK_STREAM' | xargs fgrep -w fork NB1: Busy today & a bit overwhelmed. Any ideas. First thing that came to mind was awk but see NB1 above zzapper --------------A4A368B81D07CCF511E03A3E Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

hi

By Tim chase

Dumb CLI trick. Wanted to find files containing all of several terms (dup2, pledge, socketpair, fork), but they could occur anywhere in the file: $


find . -name '*.c' | xargs fgrep -lw dup2 |xargs fgrep -lw pledge | xargs grep -l 'socketpair.*SOCK_STREAM' | xargs fgrep -w fork


NB1: Busy today & a bit overwhelmed.


Any ideas. First thing that came to mind was awk but see NB1 above


zzapper


--------------A4A368B81D07CCF511E03A3E--