Opened 17 years ago

Closed 16 years ago

Last modified 8 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:
Cc:

Description

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

-e "/CATALOG \/etc\/sgml\/OpenSP-1.5.1.cat/d" \ /etc/sgml/catalog \ /etc/sgml/sgml-docbook.cat

can be simplified to sed -i.orig \

-e "\%CATALOG /etc/sgml/OpenSP-1.5.1.cat%d" \ /etc/sgml/catalog \ /etc/sgml/sgml-docbook.cat

Change History (5)

comment:1 by kpfleming@…, 17 years ago

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

comment:2 by Randy McMurchy, 17 years ago

Oh wow, this is much simpler.

It removes two whole backslashes from the command.

:-)

comment:3 by lizardo@…, 17 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@…, 16 years ago

Resolution: fixed
Status: newclosed

comment:5 by bdubbs@…, 8 years ago

Milestone: old

Milestone old deleted

Note: See TracTickets for help on using tickets.