#!/bin/sh

files="
	AUTHORS
	COPYING
	INSTALL
	Makefile.am
	Makefile.in
	aclocal.m4
	bar.c
	config.h.in
	configure
	configure.in
	depcomp
	fd.c
	fd.h
	install-sh
	io.c
	io.h
	missing
	mkinstalldirs
	stamp-h.in
	test-001
	test-001-post.c
	test-001-pre.c
	"

tar -cf ./test-file-1.tar ${files}
if [ "$?" -ne 0 ]; then exit 1; fi
cat ./test-file-1.tar | ./bar 2> log.test-002.txt > ./test-file-2.tar
if [ "$?" -ne 0 ]; then exit 1; fi
cmp ./test-file-1.tar ./test-file-2.tar > /dev/null 2>&1
if [ "$?" -ne 0 ]; then exit 1; fi
# rm -f ./test-file-1.tar ./test-file-2.tar
exit 0
