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, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 18150 invoked from network); 31 Jan 2021 09:36:26 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 31 Jan 2021 09:36:26 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1612085786; b=QqZXF0+YnvbyyuE/bgflpC1W29JZi5716zOiXxjW6gEEZf0xIPTw48oDkiVzuO9qas4/IRYlSx m5LSuW8oDzbEwrA99YSPzEBWcET6MyL6bSksaTuTHBFqtAEDrBH6nd1x+BhxdfFY1FGzAMxOFq wRWMwprmTGksjpPVJxO2iDZinCYA++RdvQcHli/jbC09Cuf6o8/7EZZEGAqeUg0E62Emk49wxP rv1gME2e/gvqS9t1EB0nj2AN6w9Pyi4Qw/tFRVfPL1e5CSDdVGvyeOd7qVEPPTMPoonsofzzLu EtPv1b4u8Enw6kU9i7AqbZKLC6aLp2Zzsu7/YzAC0S9RPg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (relay4-d.mail.gandi.net) smtp.remote-ip=217.70.183.196; dmarc=none header.from=chazelas.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1612085786; bh=EQ20Xokg2QDds/oxUbREyrUI26AAZDEm8MXMj7C8RhQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:DKIM-Signature; b=yfOlRxtWlRuBZHbDP6deqpJKQTGUb69mLhINdwK6pFLr6MSpQcGmx5EH9yImFq+LYAenN54/BL NHk7d7whaRQ9eTynb1zFi69T+5hdzjnjYFxIqY3cevcagFp5/8hY71vGWdFLuB0p5C04iuurj7 X1Gx4Nha3WwsJ0I9idS/rZ8+dYQYiJXp6SdYYXyy3Ub51Ne5QAwsk+RgzzRCROOgKSLee0+bVL uMMyCgqBUWuV9R824EI3OGWcfNWmObvNhGMQ/C1dl1VpnkZEkFHzb0voEHR9CMJllHV1rEDgtW 7Hu3qfGi3KpAGI7edzVHN9wa+Upm6HuAWs0LAtlq+zGGcw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=WB6yOXqZDMyzaZDSdHUouH0SrXC9vhFJFcoN47BuMcE=; b=FDHTnEql4qgadDHEwvCO00gndf LMKfTjV/zUb9TpfrRqzoNOonhfpDcSIiTrvip9tEKqZpIlBtFaQV3jxaYpcO/uHzNJ91hm97v+oW+ vUsd4hSPbf66EpDoG1zWa3imMxnYjbL32t+iO+L31tfz4pgf3pet4XePCS881fmS0Z9dH9QMarRa+ iBTnSkTYFVpZx1fcg+1e8DWhKf1mucgkdul/2I2KJrKAilCSXTIVi+xlqfwipO0Kx7v1eGxnOfxo6 2wcStT/SRpQREf3Ls45mis9ATT0yxY/ck4cJ/zXXnAno4UwxMxsEMWiGpJr+XDhY9dTI5LEr8HMBD AMOc+s5w==; Received: from authenticated user by zero.zsh.org with local id 1l699d-000K2W-Ix; Sun, 31 Jan 2021 09:36:25 +0000 Authentication-Results: zsh.org; iprev=pass (relay4-d.mail.gandi.net) smtp.remote-ip=217.70.183.196; dmarc=none header.from=chazelas.org; arc=none Received: from relay4-d.mail.gandi.net ([217.70.183.196]:54343) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1l699M-000Ju9-HM; Sun, 31 Jan 2021 09:36:09 +0000 X-Originating-IP: 94.10.127.123 Received: from chazelas.org (unknown [94.10.127.123]) (Authenticated sender: stephane@chazelas.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id CD9B0E0002; Sun, 31 Jan 2021 09:36:06 +0000 (UTC) Date: Sun, 31 Jan 2021 09:36:05 +0000 From: Stephane Chazelas To: Bart Schaefer Cc: Roman Perepelitsa , Zsh hackers list , Beverly Pope Subject: Re: print -C and terminators Message-ID: <20210131093605.kusgjbaezp3foxbc@chazelas.org> Mail-Followup-To: Bart Schaefer , Roman Perepelitsa , Zsh hackers list , Beverly Pope References: <0421713D-25C5-477A-90AD-C0BD2B40EED2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Seq: 47894 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: 2021-01-30 17:08:21 -0800, Bart Schaefer: > On Sat, Jan 30, 2021 at 2:47 PM Roman Perepelitsa > wrote: > > > > I learned about it from the documentation for print: > > The paragraph about the "-l" option seems like an odd place for the > only mention of this, but the zsh doc is like that a lot. > > > I don't think I ever wrote or saw code where -l is correct and -C1 is wrong. > > With the exception of those doc examples, I don't think I ever saw or > wrote code where the argument to -C was less than two (unless it was a > variable). Oh, well. [...] I have always been annoyed at that behaviour of print -rl - outputting an empty line when not being given any argument (and print -f '%s\n' -- has the same problem). Until I saw someone on unix.stackexchange.com use print -rC1 -- which addresses the problem. I was the one suggesting it be more explicitly documented at https://www.zsh.org/mla/workers/2019/msg01202.html Since then, I've replaced all my (broken) usages of print -rl with print -rC1. I agree it wouldn't harm to also clarify in the -C documentation that nothing is output if no argument is given. This: ~$ print -raC2 a b c | sed -n l a b $ c $ ( ~$ print -rC2 a b c | sed -n l a c$ b$ ) could also be improved. -- Stephane