How can i make the output of echo become the replacement text for 'sed'? I do not understand why i cannot use $p like this.
while read p; do
sleep 1
echo $p | sudo sed -i '/AuthUser/s/= .*/= $p/' /etc/ssmtp/ssmtp.conf
done <emailaddresses.txt
How can i make the output of echo become the replacement text for 'sed'? I do not understand why i cannot use $p like this.
while read p; do
sleep 1
echo $p | sudo sed -i '/AuthUser/s/= .*/= $p/' /etc/ssmtp/ssmtp.conf
done <emailaddresses.txt