Am Dienstag, 21. September 2021, 15:23:40 CEST schrieb Tadziu Hoffmann: > Is there a reason you need grep in there? > > You can work around the issue by removing the grep completely > and do the filtering with sed: add the "-n" (no default output) > command-line option when calling sed, and the "p" (print) flag > to the substitute command: > > sed -ne 's/.../.../p'
I can not manage it with sed only, but this works as well, using awk instead: . sy pdfinfo @$1 | \ awk '/Page size/ {print ".nr pdf-wid \\(p;" $3 "\\)\\n.nr pdf-ht \\(p;" $5i "\\)\\n"}' \ > /tmp/pdfpic\n[$$] It depends on pdfinfo putting the numbers at pos $3 and $5 If you don't like to change pdfpic.tmac I could make a small script "genpdf" which calls convert and removes all \n : sed 's/\0//g' Heinz