${name:F:<expr>:}: Repeat modifier
Repeats the immediately following modifier up to <expr> times.
<expr> is an arithmetic expression.
Use :f to repeat until the value does not change anymore.
Links
Examples
- Replace first two values
- Output:
1 2 3value="a aa aaa aaaa" echo $value:F:1+1:s/a/z/1z za aaa aaaa - Replace all values
- Output:
1 2value="a aa aaa aaaa" echo $value:fs/a/z/1z zz zzz zzzz
BashSupport Pro is a Zsh IDE with support for $varName:F – try it now!