tr command is available or not

To find whether tr command is available or not on Solaris 10, i am using the following script

filename="/usr/bin/tr"
if ! [ -s $filename ]; then
echo "ERROR: tr command not found in current installation. Please install it."
exit 1
fi

I am doubtful about the following command in the above script.

filename="/usr/bin/tr"

because on my Linux machine, it is available at
/bin/tr"

What would be the best way to verify presence of tr command.

if [ `type tr>/dev/null;echo $?` -ne 'o ]
then
echo "ERROR: tr command not found in current installation. Please install it."
fi

Usually the dirs in Unix System Resources (that's what /usr stands for tough dubbed simply "user" by most admins)
that contain executables should be in your PATH, so that a which tr should find it.
As far as I remember SunOS (inherited by Solaris still) traditionally has an unusual place
where lots of executables reside, viz. /usr/xpg4/bin.
This dir that often is not in the PATH or comes after /usr/bin has implementations of well known Unix commands
that behave differently (according to some agreed upon common standard by the X/Open consortium, X/Open - Wikipedia, the free encyclopedia)
Maybe that you will find tr there.
I think HP have solved this more cleverly by making lots of Unix commands aware of the environment variable UNIX95.
If this is defined when invoking an XPG4 command it will behave differently
(the best example being ps)
As for your shell script test, I would't use the test -s which tests for the file's size (if it has any contents)
For executables better test for executability (x-bit set) by

if [ -x $some_exe ] && echo "do whatever"

You may also run a find over /usr to search for executables
e.g.

# find /usr -xdev -type f -perm -0001 | xargs ls -l

If you have GNU find you can omit the pipe to xargs but simply append -ls

For what it's worth, this is a Useless Use of Backticks and Useless Use of Test $? (and also, as far as I can tell, a syntax error; or what's with the 'o?)

if ! type tr >/dev/null 2>&1; then
  echo "ERROR: tr command not found in current installation.  Please install it." >&2
fi

The which command might or might not work as well as type but if you have a (POSIX?) Bourne shell, the type command is the builtin for finding an executable. Both of them will be somewhat constrained by your PATH so if you might have executables in funny places, either augment your PATH, or look into the stuff suggested by buffoonix