Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: (0) works as a charm

On Nov 27, 2019, at 10:24 AM, Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx> wrote:
>> * if p is present while joining, it must be present while splitting
>> * -1s/present/absent/g
>> * as the manual says: 0 means ps:\0:
> p simply converts \0 to ascii 0. It's the same as '\0' vs $'\0’.

I’m still not clear…

>        A character may be quoted (that is, made to stand for itself) by preceding it with a `\'.  `\'  followed  by  a
>        newline is ignored.
>        A  string enclosed between `$'' and `'' is processed the same way as the string arguments of the print builtin,
>        and the resulting string is considered to be entirely quoted.  A literal `'' character can be included  in  the
>        string by using the `\'' escape.
>        All  characters enclosed between a pair of single quotes ('') that is not preceded by a `$' are quoted.

Are you saying that ‘\0’ is a quoted null character while $’\0’
is a quoted string with one character which is a null and somehow
zsh keeps quoted characters different from quoted strings?

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Messages sorted by: Reverse Date, Date, Thread, Author