Opened 19 years ago

Closed 19 years ago

Last modified 10 years ago

#1239 closed defect (fixed)

Fontconfig: Simplified sed command

Reported by: lizardo@… Owned by: blfs-book@…
Priority: high Milestone:
Component: BOOK Version: SVN
Severity: normal Keywords:


The following sed command (from Fontconfig installation page) sed -i.orig \

-e "/CATALOG \/etc\/sgml\/" \ /etc/sgml/catalog \ /etc/sgml/

can be simplified to sed -i.orig \

-e "\%CATALOG /etc/sgml/" \ /etc/sgml/catalog \ /etc/sgml/

Change History (5)

comment:1 by kpfleming@…, 19 years ago

The final '%' in your proposed command is not escaped; is that an error?

comment:2 by Randy McMurchy, 19 years ago

Oh wow, this is much simpler.

It removes two whole backslashes from the command.


comment:3 by lizardo@…, 19 years ago

Kevin: No, it's used this way. See this example: cat << "EOF" | sed '\%line1%d' line1 line2 EOF It will print "line2". Actually, It's not a shell escape, but a sed syntax. The single quotes disabled the shell scapes. Randy: Actually, I meant "clearer", not simplified... IMHO, It's easier to read the command without all that escapes.

comment:4 by igor@…, 19 years ago

Resolution: fixed
Status: newclosed

comment:5 by bdubbs@…, 10 years ago

Milestone: old

Milestone old deleted

Note: See TracTickets for help on using tickets.