0

I have a file which containes an decrypted password { KRZ_CONN_PASSWORD=\{AES256:keyfile:a\}9deIfknH7AA3hg+i95mcWg\=\= }, I need to replace it with a new decrypted password which is below

{ KRZ_CONN_PASSWORD=\{AES256:keyfile:a\}UEum+VN9OGFGR/SwTBahgA\=\= }

Actual file:

INSTANCE=s0100r00 [     SECTION=customdefault [ ]       SECTION=default [ { KRZ_ORACLE_HOME=/appl/oracle/s0100r00/product/11.2.0.4 }  { KRZ_CONN_PASSWORD=\{AES256:keyfile:a\}9deIfknH7AA3hg+i95mcWg\=\= }  { KRZ_CONN_USERID=itm6_ag }  ] 

Expected result:

INSTANCE=s0100r00 [     SECTION=customdefault [ ]       SECTION=default [ { KRZ_ORACLE_HOME=/appl/oracle/s0100r00/product/11.2.0.4 }  { KRZ_CONN_PASSWORD=\{AES256:keyfile:a\}UEum+VN9OGFGR/SwTBahgA\=\= }  { KRZ_CONN_USERID=itm6_ag }  ] 
  • when you say "decrypted" don't you mean "encrypted" ? – Jeff Schaller Feb 9 '17 at 12:01
1
sed 's|\({ KRZ_CONN_PASSWORD=\\{AES256:keyfile:a\\}\)[^ ]*|\1UEum+VN9OGFGR/SwTBahgA\\=\\=/g'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.