Tag Archives: regexp

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  
This entry is part 10 of 10 in the series Unix swissknife
Posted in English Content, Knowledgebase, Unix | Tagged , | Leave a comment