Один в awk:
$ awk 'BEGIN{FS=OFS=""}/^[0-9]/ && match($0,/[a-z]/){$RSTART=toupper($RSTART)}1' file
Вывод:
2019Donaldtrump
03012019Paris
notstartingwith123
Объяснено:
$ awk 'BEGIN {
FS=OFS="" # separators to empty
}
/^[0-9]/ && match($0,/[a-z]/) { # if there is starting digit and lower case letters
$RSTART=toupper($RSTART) # capitalize the first letter
}1' file # output
Короче, match
вернет RSTART
какего значение, сохраните и используйте это вместо:
$ awk 'BEGIN{FS=OFS=""}/^[0-9]/&&r=match($0,/[a-z]/){$r=toupper($r)}1' file