1
0
mirror of https://github.com/octoleo/hosts.git synced 2024-11-22 04:45:11 +00:00

In remove, delete the link in place rather than blanking first

When using the pattern of blanking the lines first and then deleting
the blank lines, the program ends up deleting potentially intentional
blank lines. In order to avoid this, use a simple delete rather than the
blanking + blank line deleting pattern.
This commit is contained in:
William Melody 2015-03-16 17:51:28 -07:00
parent 7607dfd262
commit e867492064

2
hosts
View File

@ -690,7 +690,7 @@ remove() {
$_me help remove
exit 1
else
sed -i "s/^[^#].*[^A-Za-z0-9\.]${hostname}$//g;/^$/d" /etc/hosts
sed -i "/^[^#].*[^A-Za-z0-9\.]${hostname}$/d" /etc/hosts
fi
}