Karakas Online

6.4.6. sed: file sedscr_img line 2: Unknown option to `s'

You get the error:

editing mySGML.html
sed: file sedscr_img line 2: Unknown option to `s'
Output written to /tmp/mySGML.html_1402221460
Sed produced an empty file
- check your sedscript.
all done

When you check the offending line 2 of sedscr_img (remember that sedscr_img is dynamically generated each time you run lyxtox), you see:

s/<img src="\.\/images\/paper-sizes\.png">/<img src=".\/images\/paper-sizes.png" alt="ISO/DIN paper sizes." title="ISO/DIN paper sizes.">/g

Now it's clear what the error is: the caption to a figure contains a backslash (in "ISO/DIN"), which is used by sed as a regular expression delimiter.

The easiest solution to this seems to be: just avoid using backslash in figure captions! You cannot have everything in this world, it seems...smile

See Figure 4-2 for the corrected caption of this specific example.

Last updated Mon Sep 24 01:19:25 CEST 2007 Permalink: http://www.karakas-online.de/mySGML/unknown-option-to-s-in-sedscr_img.html All contents © 2002-2007 Chris Karakas