This has been bothering me for 3 days.
$> hostname
cepsun64amd
And I just want "cepsun",
I would normally do h=`hostname`; ${h%%64*}
But I am looking for a one-liner just for my own knowledge, because if there is a way to do this, I should know it by now.
Anyway, so is this possible?
P.S. I realize there are other ways to do this without using ${%%}, but I have ran into this problem like 4 times within the past few days where it would be really convenient and clean to just use ${VAR%%PATTERN}.
Thanks