#!/bin/bash

sed -E 's/(^|_)([a-z])/\u\2/g
t
s/[A-Z]/_\l&/g
s/^_//
:'