Running Ghostscript quietly

Discussion in 'NZ Computing' started by Lawrence D'Oliveiro, Jan 20, 2008.

  1. I've been trying to invoke gs from within a script without it printing extra
    messages. According to the man page, "-q" turns off normal messages,
    while "-dNOPAUSE" also turns off the prompting at the end of each output
    page.

    As far as I can tell, "-dNOPAUSE" simply does not work. For example, I try
    to use the following command to list all fonts known to the interpreter:

    gs -q -dNOPAUSE <<<"(*) {=} 255 string /Font resourceforall"

    but the output looks like this:

    GS>URWPalladioL-BoldItal
    ... other fonts ...
    Palatino-Italic
    GS>

    I can't seem to get rid of those useless "GS>" prompts.

    In the end, the best I could come up with was 1) add an extra blank line at
    the front of the PostScript output, so the initial "GS>" ends up on a line
    by itself, and 2) use "head" and "tail" commands to get rid of the lines
    containing the "GS>" prompts:

    gs -q <<<"() = (*) {=} 255 string /Font resourceforall" \
    | tail -n+2 | head -n-1 | sort

    By the way, I checked the effect of "-dQUIET", and that does work.
    Lawrence D'Oliveiro, Jan 20, 2008
    #1
    1. Advertising

  2. Lawrence D'Oliveiro

    Ross Guest

    On Sun, 20 Jan 2008 17:22:44 +1300, Lawrence D'Oliveiro
    <_zealand> wrote:

    >I've been trying to invoke gs from within a script without it printing extra
    >messages. According to the man page, "-q" turns off normal messages,
    >while "-dNOPAUSE" also turns off the prompting at the end of each output
    >page.
    >
    >As far as I can tell, "-dNOPAUSE" simply does not work. For example, I try
    >to use the following command to list all fonts known to the interpreter:
    >
    > gs -q -dNOPAUSE <<<"(*) {=} 255 string /Font resourceforall"
    >
    >but the output looks like this:
    >
    > GS>URWPalladioL-BoldItal
    > ... other fonts ...
    > Palatino-Italic
    > GS>
    >
    >I can't seem to get rid of those useless "GS>" prompts.
    >
    >In the end, the best I could come up with was 1) add an extra blank line at
    >the front of the PostScript output, so the initial "GS>" ends up on a line
    >by itself, and 2) use "head" and "tail" commands to get rid of the lines
    >containing the "GS>" prompts:
    >
    > gs -q <<<"() = (*) {=} 255 string /Font resourceforall" \
    > | tail -n+2 | head -n-1 | sort
    >
    >By the way, I checked the effect of "-dQUIET", and that does work.


    I don't suppose > NUL works... as in batch files?
    Ross, Jan 20, 2008
    #2
    1. Advertising

  3. In message <fmuiak$3qp$>, Lawrence D'Oliveiro wrote:

    > As far as I can tell, "-dNOPAUSE" simply does not work.


    The following command line produces the right output, without the need for
    all the "head" and "tail" and extra-line stuff:

    gsnd -q -dBATCH /dev/stdin \
    <<<"(*) {=} 255 string /Font resourceforall" | sort
    Lawrence D'Oliveiro, Jan 20, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Love Comes Quietly

    , Sep 9, 2005, in forum: DVD Video
    Replies:
    0
    Views:
    413
  2. Silverstrand

    Sapphire Quietly Launches an AGP Version of X1300XT

    Silverstrand, Sep 28, 2006, in forum: Front Page News
    Replies:
    0
    Views:
    584
    Silverstrand
    Sep 28, 2006
  3. Chris Suckling

    Can you get fans that run quietly ?

    Chris Suckling, Jan 6, 2007, in forum: Computer Information
    Replies:
    1
    Views:
    402
  4. Prince Gygyor Halimi Sarbaj Tafamus Fatarf

    "Privacy Sadism". Google does it quietly with Groups Beta, others online do it openly

    Prince Gygyor Halimi Sarbaj Tafamus Fatarf, Nov 3, 2005, in forum: Computer Support
    Replies:
    0
    Views:
    387
    Prince Gygyor Halimi Sarbaj Tafamus Fatarf
    Nov 3, 2005
  5. Prince Gygyor Halimi Sarbaj Tafamus Fatarf

    Re: "Privacy Sadism". Google does it quietly with Groups Beta, others online do it openly

    Prince Gygyor Halimi Sarbaj Tafamus Fatarf, Nov 3, 2005, in forum: Computer Support
    Replies:
    0
    Views:
    380
    Prince Gygyor Halimi Sarbaj Tafamus Fatarf
    Nov 3, 2005
Loading...

Share This Page