Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: print -C and terminators
- X-seq: zsh-workers 47892
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>, Beverly Pope <countryone77@xxxxxxxxx>
- Subject: Re: print -C and terminators
- Date: Sat, 30 Jan 2021 23:47:13 +0100
- Archived-at: <https://zsh.org/workers/47892>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-01/CAN%3D4vMpMJ7nj0d5moqOxmQ2i0uMbu1fwH%3DFCzT7XsV6hB2UUMQ%40mail.gmail.com>
- In-reply-to: <CAH+w=7atW1ArhSO0QLux_XxXR4NBmytZwZ5b79j-2CSv+Tajpg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <d611ab66-c6f9-655f-89dc-ded8697fe0ed@eastlink.ca> <CAN=4vMp+JykOWEYQ5qO495-hOpQXh+4RN6iHcYTP-APg8XHESQ@mail.gmail.com> <CAH+w=7bN7miEudLZcLknDQH3im=u8CCe_3GUqtEJMtyidV8bUg@mail.gmail.com> <CAN=4vMop86hkyYMaBkF-tJaVRaN5Z28gJLqL9tSdy-uy1DNMgg@mail.gmail.com> <0421713D-25C5-477A-90AD-C0BD2B40EED2@gmail.com> <CAH+w=7atW1ArhSO0QLux_XxXR4NBmytZwZ5b79j-2CSv+Tajpg@mail.gmail.com>
On Sat, Jan 30, 2021 at 7:52 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Sat, Jan 30, 2021 at 7:00 AM Beverly Pope <countryone77@xxxxxxxxx> wrote:
> >
> > On Jan 30, 2021, at 4:50 AM, Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author