You can't avoid it. During the kernel build, with the help of "Local version - append to the kernel release" (http://lxr.linux.no/linux+*/init/Kconfig#L56) configuration option these extra "el6.x86_64" are set and mainly to track build and release versions.
So, a possible workaround is like below:
uname -a | awk '{print $3}'
0
muhmuhten
On
Given that regex can be used, you can match the string against ^(.*)\.[^.]*$ and take the first capture group.
((.*)\..* will generally also work, with "greedy" quantifiers, but cf. a reference for your regex engine.)
0
Omeganon
On
I'm not sure how portable it is but you could do the following --
You can't avoid it. During the kernel build, with the help of "Local version - append to the kernel release" (http://lxr.linux.no/linux+*/init/Kconfig#L56) configuration option these extra "el6.x86_64" are set and mainly to track build and release versions.
So, a possible workaround is like below: