October 09, 2017 Bash search & replace Here's how to search and replace in a bash variable: TEST='hay hay' echo ${TEST/y/i} # outputs "hai hai"