File: last-1

package info (click to toggle)
hello 2.6-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,160 kB
  • ctags: 927
  • sloc: ansic: 6,070; sh: 5,175; makefile: 127; sed: 16
file content (38 lines) | stat: -rwxr-xr-x 832 bytes parent folder | download | duplicates (5)
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
#! /bin/sh
# Test that last greeting option specified is what counts.
#
# Copyright 2008 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.
# This script takes one argument.

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

# We force the C locale here, since we are checking normal output,
# which will be translated.

LANGUAGE=
LC_ALL=C
LC_MESSAGES=
LANG=
export LANGUAGE LC_ALL LC_MESSAGES LANG

tmpfiles="last-test1.ok"
cat <<EOF > last-test1.ok
my hello
EOF

tmpfiles="$tmpfiles last-test1.out"
: ${HELLO=hello}
${HELLO} -t -n -g 'my hello' | tr -d '\r' \
| tr -d '\r' >last-test1.out

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

rm -fr $tmpfiles

exit $result