I'm trying to do a simple regex statement in a bash script that will match and substitute the end of a word. Below is what I'm trying to do.
wordh > word:’
Below is the code I'm using.
#!/bin/bash
STAT=${STAT/h$/:’}
I'm not familiar with bash scripting and I'm thinking it has something to do with the $
because it's used to mark a variable. I've tried to escape it as well as adding another /
after it. When I remove the $
it works (without checking the end of a word).