#!/bin/sh
#
# This script runs through a list of machine architecture  types,  and
# tries  the  corresponding  program in /bin/ to see what it tells us.
# The results are sometimes surprising.

echo 'Testing commands in /bin/:'
for h in alpha i386 iAPX286 m68k mc68010 mc68020 osf1 pdp11 sparc sun sun2 sun3 sun386 sun3x sun4 sun4c sun4m tandem u370 u3b u3b15 u3b2 u3b5 vax
do	if [ -x /bin/$h ]
	then
		if /bin/$h
		then echo '   True: '$h
		else echo '  False: '$h
		fi
	else
		echo 'Missing: '$h
	fi
done
#
# Suns have an "arch" command, but it is rather flakey. It gives error
# messages for most of the above architecture types, and it writes its
# error messages to stdout, not stderr.
echo 'Testing /bin/arch:'
if [ -x /bin/arch ]
then
	for h in alpha i386 iAPX286 m68k mc68010 mc68020 osf1 pdp11 sparc sun sun2 sun3 sun386 sun3x sun4 sun4c sun4m tandem u370 u3b u3b15 u3b2 u3b5 vax
	do	if /bin/arch $h 1>/dev/null 2>&1
		then echo '   True: 'arch $h
		else echo '  False: 'arch $h
		fi
	done
fi
