I have a text file that I want sed to add a few lines to right before an existing line.
What I want to add is:
currentpagedevice /InputAttributes get 0 get
dup null eq
{ pop }
{ dup length 1 add dict copy
dup /InputAttributes
1 dict dup /Priority [0 1 2 3] put
put setpagedevice
} ifelse
And I want it right before the line containing the following:
Page: 1 1
Here's what I have in a file called sedscript.sed, but it doesn't seem to do anything..:
s#Page: 1 1#\
\i\ncurrentpagedevice /InputAttributes get 0 get\ndup null eq\
\n{ pop }\n{ dup
length 1 add dict copy\
\ndup /InputAttributes\
\n1 dict dup /Priority [0 1 2 3] put\
\nput
setpagedevice\
\n} ifelsei#
Here's how I call it:
sed -f sedscript.sed def011.txt
Thanks for your help in advance.