blob: f578cf144900a9e514d9b794ff34fed92e03e6af (
plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#! /bin/sh
#
# $NetBSD: getpapersize,v 1.2 1999/09/05 18:38:55 kim Exp $
#
# Small shell script to show the default papersize for packages
#
if [ $# -eq 0 ]; then
pkgs="a2ps ddd enscript magicfilter psutils";
else
pkgs=$@
fi
set $pkgs
while [ $# -gt 0 ]; do
case $1 in
a2ps)
f=@localbase@/etc/a2ps-site.cfg
if [ -e $f ]; then
echo -n "$1 has default papersize: "
awk '/^Options: --medium=/ { gsub(".*=", "", $0); print $0; }' $f
fi
;;
ddd)
f=@x11base@/lib/X11/app-defaults/Ddd
if [ -e $f ]; then
echo -n "$1 has default papersize: "
awk '/^@Ddd\*paperSize: / { gsub(".*:", "", $0); print $0; }' $f
fi
;;
enscript)
f=@localbase@/etc/enscript.cfg
if [ -e $f ]; then
echo -n "$1 has default papersize: "
awk '/^DefaultMedia:.*/ { gsub(".*:", "", $0); print $0; }' $f
fi
;;
magicfilter)
magicdir=@localbase@/libexec/magicfilter
if [ -e $magicdir ]; then
done=0
for f in $magicdir/*-filter; do
if [ $done -eq 0 ]; then
echo -n "$1 has default papersize: "
grep 'PAPERSIZE' $f | sed -e 's|\(.*\)-sPAPERSIZE=\([a-zA-Z0-9_]*\)\(.*\)|\2|' | tail -n 1
done=1
fi
done
fi
;;
psutils)
f=@localbase@/etc/psutils.cfg
if [ -e $f ]; then
echo -n "$1 has default papersize: "
awk '/^PAPERSIZE=/ { gsub(".*=", "", $0); print $0; }' $f
fi
;;
*)
echo "Warning: Package $1 not recognised"
;;
esac
shift 1
done
exit 0
|