Script using sed adds an "e" to the output files
Solution 1:
You need separate -i
and -e
arguments to sed. -ie
is telling sed to create a backup file with an 'e' appended.
To fix, just replace the sed invocation above to:
sudo sed -i -e "s/NEWUSERNAME/$username/" /etc/apache2/sites-available/$newdomain