sed usage

Gerard Beekmans gerard at
Fri Jul 21 04:59:28 PDT 2000

> I have some thoughts about your sed usage:
> I'd prefer this use:
> cp Makefile Makefile2
> sed s/"..."/"..."/ Makefile2 >Makefile
> So you even have a backed up Makefile in case you mistyped something. And
> further please use "" everywhere, just in case someone uses them in
> shell scripts as

You mean double quoted "" as in ""..."" or single quoted "..."?

A good idea, but really necessary? I mean if you do make a typo it's not
the end of the world. Untar/uncompress the package and try again.

The thing is, if I backup a file here before sed'ing on it, I need to
tell you to make a backup of other files too when the book mentions you
have to edit them (like the MCONFIG file for the util-linux package).

Now, granted, if you edit a file you usually know what you're doing. Not
everybody knows how to use sed and a s/.../... structure isn't always
clear, especially when I break a long line down in two or three lines by
ending a line with a \ (a wrong space will cause sed to fail and won't
give you the desired file), so perhaps in this particulair case
backing up wouldn't be a bad thing to do.

Gerard Beekmans

-*- If Linux doesn't have the solution, you have the wrong problem -*-
Mail archive:
IRC access: server: port: 6667 channel: #LFS
Unsubscribe: email lfs-discuss-request at and put
"unsubscribe" (without the quotation marks) in the body of the message
(no subject is required)

More information about the lfs-dev mailing list