Hi Eric, I think your proposal '-w' is good, so I will change to use:
if ! echo "$RET" | grep -qw 'ubuntu'; then Mathieu, How about using '/b' ? I mean using the following regex /bin/sed -i "s/\b${CURRENT_HOSTNAME}\b/${NETCFG_HOSTNAME}/g" /etc/hosts I have done some test below: hua@t440p:~$ echo "node" | sed "s/\bnode\b/newnode/g" newnode hua@t440p:~$ echo "node." | sed "s/\bnode\b/newnode/g" newnode. hua@t440p:~$ echo "node.me.com" | sed "s/\bnode\b/newnode/g" newnode.me.com hua@t440p:~$ echo "ipv6-allnodes" | sed "s/\bnode\b/newnode/g" ipv6-allnodes hua@t440p:~$ echo "ipv6-allnodes node node.me.com node2 node2.me.com" | sed "s/\bnode\b/newnode/g" ipv6-allnodes newnode newnode.me.com node2 node2.me.com any thoughts ? - joshua -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1452202 Title: ubuntu preseed install fails to set a hostname To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1452202/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs