linuxsedredhat

sed -e expression char 42 unterminated command `s' command


I have this sed command for adding a password to a file:

sed -i "s/password:/password: $escaped_password/" "$file"

If I replace the $escaped_password with the password, the script works, I have no idea how to fix it.


Solution

  • The command was good but the password field contained two passwords separated by a new line