Bash Generate Secure Random String Python Replace Substring