help-gv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[help-gv] Feature request: buffering data from stdin


From: Stefan Illy
Subject: [help-gv] Feature request: buffering data from stdin
Date: Thu, 23 Aug 2007 14:08:06 +0200

Dear gv developers!

I have the following feature request:

Sometimes it's convenient to use gv with postscript data coming from stdin
(simple example: dvips -f foo.dvi | gv -)

But this has a big disadvantage: it's not possible to select pages,
print, move back to the beginning of the document, etc)

To avoid this behavior I wrote a simple shell-script wrapper which
copies the data from stdin to a temporary file and then opens this file
with the gv binary (I'll append the script below).

My question: do you think it makes sense to include this behavior
directly in the gv binary, or, as an alternative, to distribute gv with
a shell script wrapper with the same functionality?

Anyhow, thank you for this great tool!

Stefan


Here comes my wrapper script:

----snip----
#!/bin/sh
#  gv.sh: Wrapper for `gv' to allow input from stdin (`-').
GV=/usr/X11R6/libexec/gv
TMPFILE=/tmp/gv.sh-$USER-$$.ps
FILENAME=""
OPTIONS=""
umask 0066
while [ $# -gt 0 ]; do
  if [ -r $1 ]; then
    FILENAME=$1
  elif [ "$1" = "-" ]; then
    cat > $TMPFILE
    FILENAME=$TMPFILE
  else
    OPTIONS="$OPTIONS $1"
  fi
  shift
done
$GV $OPTIONS $FILENAME
rm -f $TMPFILE
----snip----


reply via email to

[Prev in Thread] Current Thread [Next in Thread]