${name:&}
: Repeat substitution
Repeats the previous :s
substitution.
Use :g&
to replace all occurrences of the previous substitution.
Links
Examples
- Print path without file extension
- Output:
1 2 3 4 5
value="Joe Dalton, William Dalton, Jack Dalton and Averell Dalton" # Strip first "Dalton" value=${value:s/ Dalton//} # Strip all remaining echo ${value:g&}
1
Joe, William, Jack and Averell
BashSupport Pro is a Zsh IDE with support for $varName:amp – try it now!