zsh-workers
 help / color / mirror / code / Atom feed
From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>,
	Beverly Pope <countryone77@gmail.com>
Subject: Re: print -C and terminators
Date: Sat, 30 Jan 2021 23:47:13 +0100	[thread overview]
Message-ID: <CAN=4vMpMJ7nj0d5moqOxmQ2i0uMbu1fwH=FCzT7XsV6hB2UUMQ@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7atW1ArhSO0QLux_XxXR4NBmytZwZ5b79j-2CSv+Tajpg@mail.gmail.com>

On Sat, Jan 30, 2021 at 7:52 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> On Sat, Jan 30, 2021 at 7:00 AM Beverly Pope <countryone77@gmail.com> wrote:
> >
> > On Jan 30, 2021, at 4:50 AM, Roman Perepelitsa <roman.perepelitsa@gmail.com> wrote:
> >
> > >  print -rC1 --
> > >
> > > This command doesn't print anything.
> >
> > % print -rC1 -- no_such_file(N)
>
> This behavior seems like a bug to me.  Neither -n nor -N were
> specified, so "print" should always output at least a newline.
> However, it's been around for quite some time and obviously some
> people know about it, so I suppose it should just be documented.

I learned about it from the documentation for print:

  -l  Print the arguments separated by newlines instead of spa-
      ces.  Note: if the list of arguments is empty,  print  -l
      will  still  output  one  empty  line.  To print a possi-
      bly-empty list of arguments one per line, use print  -C1,
      as in `print -rC1 -- "$list[@]"'.

I don't think I ever wrote or saw code where -l is correct and -C1 is wrong.

Roman.


  parent reply	other threads:[~2021-01-30 22:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <d611ab66-c6f9-655f-89dc-ded8697fe0ed@eastlink.ca>
     [not found] ` <CAN=4vMp+JykOWEYQ5qO495-hOpQXh+4RN6iHcYTP-APg8XHESQ@mail.gmail.com>
     [not found]   ` <CAH+w=7bN7miEudLZcLknDQH3im=u8CCe_3GUqtEJMtyidV8bUg@mail.gmail.com>
     [not found]     ` <CAN=4vMop86hkyYMaBkF-tJaVRaN5Z28gJLqL9tSdy-uy1DNMgg@mail.gmail.com>
     [not found]       ` <0421713D-25C5-477A-90AD-C0BD2B40EED2@gmail.com>
2021-01-30 18:51         ` Bart Schaefer
2021-01-30 19:08           ` Beverly Pope
2021-01-30 22:47           ` Roman Perepelitsa [this message]
2021-01-31  1:08             ` Bart Schaefer
2021-01-31  9:36               ` Stephane Chazelas
2021-01-31 21:12                 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN=4vMpMJ7nj0d5moqOxmQ2i0uMbu1fwH=FCzT7XsV6hB2UUMQ@mail.gmail.com' \
    --to=roman.perepelitsa@gmail.com \
    --cc=countryone77@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).