Below command is used to replace the password in a script but the perl command is adding a white space when it does the subsstitution
password=arche20 perl -i -p -e "s/^(password*=[ ]*).*$/\1 $passwd/" config.properties cat config.properties userid=ARCHE password= arche20
It does the work but it seems to be adding a space after password when it replaces.
Could this be done without the space?
sed -i "s/password.*/password=$passwd/g"