ylliX - Online Advertising Network

environment variable not read in sed

I am trying to update sudoers via script and passing the value of $HOSTNAME and it’s not working..obviously missing something. I am expecting: %[email protected] ALL=(ALL:ALL) ALL %[email protected] ALL=(ALL:ALL) ALL Below are the many attempts and results: sed -i “/#My Customization.*/a%[email protected] ALL=(ALL:ALL) ALL\n””%”${HOSTNAME}”[email protected] ALL=(ALL:ALL) ALL” /tmp/sudoers.bak1 Returns: %[email protected] ALL=(ALL:ALL) ALL %[email protected] ALL=(ALL:ALL) ALL sed -i “/#My […]