${(s:string:)…}
: Splitting separator
s:string:
defines the splitting separator string when word splitting is applied.
The complete string is used as separator. With an empty string each character is split into a separate word.
Links
Examples
- Split by string
- Output:
1 2 3
value="Sunday-Monday-Tuesday-Wednesday-Thursday-Friday-Saturday" days=( ${(s:-:)value} ) typeset days
1
days=( Sunday Monday Tuesday Wednesday Thursday Friday Saturday )
BashSupport Pro ist eine Zsh IDE mit Unterstützung für ${(s)…} - probieren Sie es jetzt aus!