When I pipe postscript data into the gs program, gs interprets the data and then immediately exits. This matches the man page:

   -      This is not really a switch, but indicates to  Ghostscript  that
          standard  input is coming from a file or a pipe and not interac-
          tively from the command line.  Ghostscript reads  from  standard
          input  until it reaches end-of-file, executing it like any other
          file, and then continues with processing the command line.  When
          the  command line has been entirely processed, Ghostscript exits
          rather than going into its interactive mode.

Is there a way that I can force gs into interactive mode when run as a pipe? I know that I can dump my data into a temp file, run gs tempfile and then remove the temp file, but I'd prefer to do it all in one step.


use gs <( program_writing_ps_to_sdout )

  • 3
    Can you spell out how this works? – music2myear Dec 23 '16 at 21:59
  • @music2myear -- the <( ) construct means "run the command in the parentheses ... and then the main command should pretend that the output came from a file." – hymie Dec 24 '16 at 2:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.