I have a variable in my shell script that looks like this:
DIR="HOME_X_Y_Z";
It represents a directory name. Imagine I have multiple directories all named something like this:
HOME_1_2_Z/
HOME_9_A_Z/
HOME_3_5_Z/
etc...
The only values that change are those located at position X and Y. Is there a regular expression I could use (maybe with sed or awk) to peel those values out? I want to be able to used them independently elsewhere in my script.
So I would be able have 2 more variables:
X_VALUE="";
Y_VALUE="";
Thanks