in reply to Re: Find and replace MD5 hash from file
in thread Find and replace MD5 hash from file

Thanks for the help, your solution works great but I forgot to mention that the file contains more then just the hashes.

For example user:$1$7FWHShP3$QzHTcsaII5leWMSv6weND7vSS1KMvcsjfYpiDZxc.TCAVR6XUdLaLtUBVTTwPFXZBKs52DRzW1UKFZ5JB27yI0:15152:0:99999:7:::

What needs to be modified in order for something like the above to work?

Thanks again

  • Comment on Re^2: Find and replace MD5 hash from file

Replies are listed 'Best First'.
Re^3: Find and replace MD5 hash from file
by ikegami (Patriarch) on Jun 29, 2011 at 20:28 UTC

    I switched from «s/.../.../» to «s/^...$/.../» to avoid possibly matching the wrong things. I incorrectly guessed your file format. You could revert to using «s/.../.../», or you could use the more restrictive «s/:...:/:...:/».

      Thx you very much