#!/bin/ksh


shells='
/bin/ksh
/opt/local/bin/ksh
/opt/local/bin/ksh93u+
/opt/local/bin/ksh93v-
/opt/ast/bin/ksh
/opt/ast/bin/bash
/bin/bash
'


for s in $shells; do
	[[ -x $s ]] || continue
	echo $s
	$s -s <<-\EOF
		echo ${.sh.version}
		a=0
		function f {
			typeset a=1
			echo $a
		}
		g() {
			typeset a=2
			echo $a
		}
		echo $a
		f
		echo $a
		g
		echo $a
	EOF
	echo
done

sw_vers


exit 0
