Reputation: 7759
I work with .bash script and I try to remove lines from file
sed -e s/^DNS1.*/''/g -i $DNS_IP_CONFIG_FILE
but remains blank lines.I need baskspace in this code
Upvotes: 0
Views: 173
Reputation: 77185
sed -i -ne '/^DNS1.*/!p' $DNS_IP_CONFIG_FILE
Upvotes: 1
Reputation: 20516
sed -i '/^DNS1.*/d' $DNS_IP_CONFIG_FILE
Upvotes: 5
Reputation: 50144
sed -i -e '/^DNS1/d' "$DNS_IP_CONFIG_FILE"