${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.

Examples

Replace first two values
1
2
3
value="a aa aaa aaaa"
echo $value:F:1+1:s/a/z/
  
Output:
1
z za aaa aaaa
Replace all values
1
2
value="a aa aaa aaaa"
echo $value:fs/a/z/
Output:
1
z zz zzz zzzz
BashSupport Pro is a Zsh IDE with support for $varName:Ftry it now!
© 2020–2024 Joachim Ansorg
Imprint
Privacy Policy
Legal