I try to substract the first string before a dot
(.
) in bash.
For instance:
1.2.3 -> 1
11.4.1 -> 11
I used the following command based on the docs:
s=4.5.0
echo "${s%.*}"
But it ouptuts 4.5
instead of 4
. I don't get it.
Why is that?
echo "${s%%.*}"
? – Insanity