Changeset 993 for pykota/trunk/untested

Show
Ignore:
Timestamp:
05/10/03 08:37:58 (21 years ago)
Author:
jalet
Message:

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.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/untested/postscript/pagecount.sh

    r987 r993  
    11#!/bin/sh 
    22# 
    3 # Adapted and modified from the printquota project  
    4 # http://printquota.sourceforge.net 
     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. 
    528# 
    629# printquota (c) 2002-2003 Ahmet Ozturk & Cagatay Koksoy 
    730# printquota is distributed under the GNU General Public License 
    831# 
    9 # Usage : pagecount.sh file.ps 
     32# Usage : pagecount.sh <file.ps 
    1033# 
    1134( 
    12 (cat $* | sed -n -e '/%!PS-Adobe-/,/\%\%EOF/p' | grep -E -v "/Duplex|PageSize") 
     35(sed -n -e '/%!PS-Adobe-/,/\%\%EOF/p' | grep -E -v "/Duplex|PageSize") 
    1336echo currentdevice /PageCount gsgetdeviceprop == flush 
    1437) | gs -q -sDEVICE=bit -sOutputFile=/dev/null -r5 - | tail -1