File: greeting-1

package info (click to toggle)
hello 2.2-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,056 kB
  • ctags: 273
  • sloc: sh: 4,418; ansic: 2,493; makefile: 101; sed: 16
file content (34 lines) | stat: -rwxr-xr-x 956 bytes parent folder | download | duplicates (10)
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
#! /bin/sh
# Test arbitrary --greeting.
#
# Copyright (C) 2001, 2006 Free Software Foundation, Inc.
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.

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

# No locale settings in this test, since we are using a fixed string;
# nothing in the output should be locale-dependent.

tmpfiles="greeting-test1.ok"
cat <<EOF >greeting-test1.ok
Nothing happens here.
EOF

tmpfiles="$tmpfiles greeting-test1.out"
: ${HELLO=hello}
${HELLO} -g 'Nothing happens here.' | tr -d '\r' >greeting-test1.out

# remove \r (CR) characters from the output, so that the tests work on
# platforms with CRLF line endings.  There is apparently no reliable
# method (across Cygwin, MingW, etc.) to force an eol style.

: ${DIFF=diff}
${DIFF} greeting-test1.ok greeting-test1.out
result=$?

rm -fr $tmpfiles

exit $result