I wrote the following to convert something like foo-bar-baz
to FooBarBaz
sed -r 's/^(.)|-(.)/\U\1\U\2/g'
(Feel free to correct the above if there is something wrong)
However, it does not work with busybox :(
I could cobble something together with cut
, for
loops, bash substrings, and tr
, but there must be a good one liner using busybox version of sed, awk, whatever. Thoughts?
\U
(which is likely), then a sed solution can't work. – Outlawry(.)
to have it only match alphabetics, or even only lowercase alphabetics. Perhaps numbers too if that's permissible?([a-z0-9])
– Stubbs