Prevent Ghostscript from writing errors to standard output

偶尔善良 提交于 2019-12-03 14:44:22

If you want to really silence Ghostscript, modify your command line like this:

/usr/bin/gs -q        \
     -sstdout=%stderr \
     -sDEVICE=jpeg    \
     -dBATCH          \
     -dNOPAUSE        \
     -dLastPage=1     \
     -r300            \
     -sOutputFile=-   \
     - < test.txt 2>/dev/null

The addition of -sstdout=%stderr allows Postscript stdout to be redirected, while still allowing drivers to write to stdout. (That patch is in Ghostscript since ~2001, Sept 22.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!