Command output string manipulation possible in one line?

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

$ echo "cepsun64amd" | cut -c 1-6
cepsun

---------- Post updated at 07:44 AM ---------- Previous update was at 07:43 AM ----------

$ echo "cepsun64amd" | sed 's/sun.*/sun/'
cepsun

I take that as "no."