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

Re: Trying to reverse a word.



On Oct 20, 12:01am, Mikael Magnusson wrote:
} Subject: Trying to reverse a word.
}
} % echo "${(j::)${(Oa)${(s::):-hello}}}"
} h e l l o
} What the heck is going on here?

The double quotes cause ${(Oa)${(s::):-hello}} to be joined with the
default IFS before the (j::) is ever applied.  Add an (@) to force
that array to remain an array:

echo "${(j::)${(@Oa)${(s::):-hello}}}"



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