reverse ':' separated numbers in a shell script

I want to reverse a the following:
00:11:22:33:44:55

I currently use something like below to pass it as is.
But now I want the same script to reverse the above and pass it to ethtool.

// psuedo code

i=0
skip=0
for m in $@
do
if [ $skip -eq 0 ]
then
skip=1
for b in $(echo $m | tr ':' ' ')
do
ethtool -E eth$i offset $c value 0x$b
c=$(($c + 1))
done
else
skip=0
fi
i=$(($i + 1))
done
echo "OK"

Thank you

  • bhan

Hope this will be helpful

$ echo 00:11:22:33:44:55|awk -F":" '{for(i=NF;i>1;i--) printf("%s:",$i);print $1}'
55:44:33:22:11:00

Regards,

Ranjith