${(#)…}
: Evaluate as character codes
Evaluates the resulting words as character codes and converts them into corresponding characters.
Links
Examples
- Print message using ASCII values
- Output:
1 2 3 4 5 6 7
# decimal ASCII values ascii=(72 101 108 108 111) echo ${(#)ascii} # hex ASCII values ascii=(0x57 0x6F 0x72 0x6C 0x64) echo ${(#)ascii}
1 2
H e l l o W o r l d
BashSupport Pro is a Zsh IDE with support for ${(#)…} – try it now!