Problem with sed

Thomas Dickey dickey at
Mon May 18 13:18:55 UTC 2015

----- Original Message -----
| From: "Jerry" <jerry at>
| To: "FreeBSD FreeBSD" <freebsd-questions at>
| Sent: Monday, May 18, 2015 9:00:51 AM
| Subject: Problem with sed
| I rarely use sed, so I admit to not being fully acquainted with its
| idiosyncrasies,; however, this one is really annoying.
| I am using this command in an attempt to remove empty lines:
| $ sed -i /^$/d /var/tmp/myfile.txt

you have to quote the expression to prevent the '^' and '$' characters from being interpreted by the shell,
for example 

sed -i '/^$/d' /var/tmp/myfile.txt

Thomas E. Dickey <dickey at>

More information about the freebsd-questions mailing list