Artificial intelligent assistant

Extra space between perl /sed replacement 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? Got a `sed` way: sed -i "s/password.*/password=$passwd/g"

You have a space after `\1` in your replacement, just remove that and you should be good


perl -i -p -e "s/^(password[]*=[ ]*).*$/\1$passwd/" config.properties
^
Removed space here

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 14b6b5004a02d2b3b14d0a2f4eaeff43