#!/bin/bash
s="this_is_my_task() this_is_my____task() ___this_is_my_task() or tHhi_is_my task()"
perl -pe 's{\b[a-z]+(?:_[a-z]+)+\(\)}{$&=~s/_([a-z])/\u$1/gr}ge'  <<< "$s"
