We have the following configuration file
more /tmp/file delete.topic.enable=true broker.id=-1 advertised.listeners=null . . .
We need to convert all syntax above as the following:
- Change the characters until “=” separator to uppercase characters
KAFKA_in the beginning of each line
- Replaces each dot “.” To under line “_” until the “=” separator
Example of expected results
KAFKA_DELETE_TOPIC_ENABLE=true KAFKA_BROKER_ID=-1 KAFKA_ADVERTISED_LISTENERS=null . . .
Any sed suggestion for this changing ?
We try this ,
but this also convert the charterers after the “=” separator ( not as should be ) , and also we not sure how we can add the
KAFKA_ in the beginning
sed 's/[a-z]/\U&/g' /tmp/file | sed s'/\./_/g' DELETE_TOPIC_ENABLE=TRUE BROKER_ID=-1 ADVERTISED_LISTENERS=NULL . .