Bash Regular expression replace (regexp)

You can easily use bash to search-and-replace on variables...

f="/home/alice/myfile.md"
$ echo ${f//.md/.pdf}
/home/alice/myfile.pdf

$ echo ${f//alicee/bob}
/home/alice/myfile.md

$ echo ${f////-}
-home-alice-myfile.md


 

[caption id="attachment_11865" align="alignnone" width="267"] Splinch[/caption]