Hello Everyone,
I need to read an encrypted password from the user and update that value in an xml file. I am trying to use "sed" for searching the appropriate tag and replacing this new value that get from the user. Since the encrypted password can contain special characters(like /,\,&,etc), the "sed" command is coming garbled. Could somebody please help to find an efficient solution for this problem?
Is there a way to instruct sed command not to consider any special characters in the replacement string?
Something like
s/${key}/"what ever string"/
Or
Any efficient way to put escape sequence for the special characters?
I tried something like
's/\|/\\|/g' , 's|\\|\\\\|g'
to escape individual special characters. But this is not working for special characters like &,/ etc.... Is it possible to write any generic pattern which can handle any special characters.
Very much appreciate any help
Thanks,
Martin