I am trying to replace all white spaces with _. I used the following code:
FONT="DejaVu Sans Mono"
FONT_CODE=${FONT//[ ]/_}
echo $FONT_CODE
I'm expecting DejaVu_Sans_Mono as the output But I got the following error :
x.sh: 2: Bad substitution
I am not sure what I need to do to get work.