#!/bin/bash
case $(basename $0) in

name1)
	echo I was called as $0
	;;

name2)
	echo I was called as $0
	;;

*)
	echo I was called as $0
	;;

esac
exit $?


syntax highlighted by Code2HTML, v. 0.9.1