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

Printing square brackets and backslashes



    Hi all :)

    $ print \[\\\]
    []
    $ /bin/echo -e \[\\\]
    [\]
    $ print -r \[\\\]
    [\]
    $ print \\
    \

    I was expecting the second when issuing the first command...
As I understand, the string should be interpreted as "a quoted
opening square bracket, a quoted backslash, a quoted closing square
bracket", but it is not :?? But in the last case, "print" is
correctly quoting the backslash :?

    I discovered this when I accidentally created a file named "[\]"
when testing the behaviour that one of my scripts has with weird
characters, and then I did "print *" and got that problem.

    What am I misunderstanding here? Thanks a lot in advance :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...



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