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

(about quoting) Re: (0) works as a charm



hello,

> 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?

the opposite: $'' is yet another quoting style in zsh to know what
will be expanded

       | ""    $''  ''  none
    ---+-----------------
    $  | yes   no   no  yes
    \  | yes   yes  no  no[1]
    
    [1] remove the '\' symbol

    print -r "\n" $'\n' '\n' \n | xxd

first i was confused because by default, print interpolate \
before printing as long as you don't use -r.

so

    x='\0'
    print $x
    x=$'\0'
    print $x

looks the same

regards
marc



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