File: testpr

package info (click to toggle)
lprng 3.8.B-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,344 kB
  • sloc: ansic: 35,071; sh: 3,040; perl: 1,896; makefile: 380
file content (39 lines) | stat: -rwxr-xr-x 881 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/local/bin/bash
#
#  use:  testpr [last job number [first job number]]
# testpr script
#
# Throughput and lost file test script
#
#  Set up a print queue with:
#   lp:sd=/tmp/lpd/%P
#     :filter=/tmp/testfilter
#     :lp=/dev/null
#
# /tmp/testfilter:
#   #!/bin/sh
#    #  The filter will create files in /tmp/files with the name
#    #  corresponding to the first word in file
#   if [ ! -d /tmp/files ] ; then mkdir /tmp/files ; fi
#   read var
#   var=`echo $var | sed -e 's,.*/,,'` 
#   date >/tmp/files/$var
#
# now do:
#
# chmod a+x /tmp/testfilter
# run checkpc 
# 
# Send jobs  using:
# bash testpr (10 jobs)
# bash testpr 100 (100 jobs)
# bash testpr 200 100 (100, starting at id 100 jobs)

P=-Pp
set -x
lprm $P all
d=/tmp/files
if [ ! -d $d ] ; then mkdir -p $d; fi
chmod 777 $d;
(cd $d; rm -f *;)
for((i=${2:-0}; i < ${1:-10}; ++i)) ; do echo $i |lpr $P ; done;