I need to replace last dot to character '-' in the string.
# a='2.5.2.pl'
Using the following expression:
# echo ${a/%./-}
I expect to get:
2.5.2-pl
but i get
2.5.2.pl
I noticed that it doesn't work only if I need to replace the dot from the end to the beginning. Why does it happen? Of course I can use external programs like awk, sed to solve this problem but I need to solve the problem using only bash.
Thanks for advice!