Do you mean the actual password has two, or the escaped string had two (meaning the password has one)?
On Thu, 14 May 2020 at 21:38, Mark T. <[email protected]> wrote: > Hello, > > Thanks for the feedback. Your code works with all special characters that > I've used, but I run into a problem when there are two backslashes (\\) > side-by-side in a password. > > Is there any way to fix this? > > Regards, > > Mark > > On Wednesday, April 1, 2020 at 1:14:36 PM UTC-4, Mark T. wrote: >> >> Hello, >> >> - name: Determining Source Account DB Password >> shell: cat wp-config.php | grep DB_PASSWORD | awk -F"['']" '{print >> $4}' >> register: wp_dbpw_source >> >> If the password contains a backslash, the output doubles the number of >> backslashes. >> >> abc\*# becomes abc\\*# >> >> I'm aware extra escape characters are only for display purposes, and not >> actually sent to the command. >> >> But the distorted password output prevents the script from accessing the >> database. When I remove the backslash from the password, the script works >> again. >> >> Is there a way to output a shell command using grep, cat or awk that >> doesn't cause this distortion? >> >> Thanks, >> >> Mark T. >> > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/77081a97-1bcd-45b9-a506-a36e9417d689%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/77081a97-1bcd-45b9-a506-a36e9417d689%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Sent from a mobile device - please excuse the brevity, spelling and punctuation. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAL8fbwMbJmQ6koh0%2BdiZck2yXZc%2B0Om2EjFAdHLVxUSJf8L2Lw%40mail.gmail.com.
