File: onsgmls-2

package info (click to toggle)
opensp 1.5.2-15.2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,168 kB
  • sloc: cpp: 65,784; ansic: 17,124; sh: 11,193; xml: 2,704; makefile: 895; perl: 561; yacc: 288; sed: 16
file content (48 lines) | stat: -rwxr-xr-x 1,153 bytes parent folder | download | duplicates (7)
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
#!/bin/sh
# onsgmls: test --restricted and --directory=

LANG=C; export LANG
LC_ALL=C; export LC_ALL

tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15

tmpfiles="$tmpfiles onsgmls-2.sgml"
cat <<EOF >onsgmls-2.sgml
<!DOCTYPE doc [
<!ELEMENT doc - o (#PCDATA)>
<!ATTLIST doc
  n CDATA #IMPLIED>
]>
<doc n=1>
EOF
tmpfiles="$tmpfiles onsgmls-2-dir onsgmls-2.out"

: ${ONSGMLS=onsgmls}
mkdir onsgmls-2-dir || { echo "cannot create onsgmls-2-dir"; exit 1; }
touch onsgmls-2-dir/o2.cat
echo onsgmls-2a >onsgmls-2.out
cat onsgmls-2.sgml | ${ONSGMLS} -c onsgmls-2-dir/o2.cat 2>>onsgmls-2.out \
  1>/dev/null 
echo onsgmls-2b >>onsgmls-2.out
cat onsgmls-2.sgml | ${ONSGMLS} --restricted -c onsgmls-2-dir/o2.cat \
  2>&1 1>/dev/null | sed 's/.*onsgmls://' >>onsgmls-2.out
echo onsgmls-2c >>onsgmls-2.out
cat onsgmls-2.sgml | ${ONSGMLS} --restricted --directory=onsgmls-2-dir \
  -c onsgmls-2-dir/o2.cat 2>>onsgmls-2.out 1>/dev/null 

tmpfiles="$tmpfiles onsgmls-2.ok"
cat <<EOF >onsgmls-2.ok
onsgmls-2a
onsgmls-2b
E: cannot find "onsgmls-2-dir/o2.cat"; tried 
onsgmls-2c
EOF

: ${DIFF=diff}
${DIFF} onsgmls-2.ok onsgmls-2.out
result=$?

rm -fr $tmpfiles

exit $result