Do I have #regex experts among my followers: echo "123.4506000" | sed -E 's/(\.[0-9]*[1-9])?0+$//; s/\.$//' is intended to remove trailing 0s when its a number with a decimal point. But when there are no cifers behind the decimal point other than 0s, the whole number shall be stripped of the point and the 0s. What are I am doing wrong? Sharing appreciated.