root / pykota / trunk / untested / postscript / pagecount.sh @ 1128

Revision 993, 1.3 kB (checked in by jalet, 22 years ago)

Small simplification so that it reads the job's data from standard
input. This way it is now directly useable as a PyKota external accounter.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1#!/bin/sh
2#
3# PyKota
4#
5# PyKota : Print Quotas for CUPS and LPRng
6#
7# (c) 2003 Jerome Alet <alet@librelogiciel.com>
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program; if not, write to the Free Software
20# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
21#
22# $Id$
23#
24#
25#
26# This script was freely adapted and modified from the printquota project
27# http://printquota.sourceforge.net for inclusion into PyKota.
28#
29# printquota (c) 2002-2003 Ahmet Ozturk & Cagatay Koksoy
30# printquota is distributed under the GNU General Public License
31#
32# Usage : pagecount.sh <file.ps
33#
34(
35(sed -n -e '/%!PS-Adobe-/,/\%\%EOF/p' | grep -E -v "/Duplex|PageSize")
36echo currentdevice /PageCount gsgetdeviceprop == flush
37) | gs -q -sDEVICE=bit -sOutputFile=/dev/null -r5 - | tail -1
Note: See TracBrowser for help on using the browser.