${name:s/<search>/<replace>/}: Search and Replace

Substitutes the first occurrence of <seach> with <replace>.

Use :gs/<search>/<replace>/ to replace all occurrences of <search>.

Examples

Print path without file extension
1
2
path="/dir/subdir/file.csv"
echo $path:r
Output:
1
/dir/subdir/file
BashSupport Pro ist eine Zsh IDE mit Unterstützung für $varName:s - probieren Sie es jetzt aus!
© 2020–2024 Joachim Ansorg
Impressum
Datenschutz
Rechtliches