Parse the output of /Developer/Tools/GetFileInfo (part of the XCode suite). In the "attributes" field, "A" indicates an Aqua alias, "a" indicates a real Aqua file (a "real" file or a unix symlink). Not sure how to find its target that way.
Alternately, you could probably use one of the command-line utilities in the
osxutils suite: "lsmac" appears to resolve Aqua aliases to their targets but not unix symlinks.
Or since you already know how to do [whatever you want] in python, why not use a python one-liner in your bash script?
python -c "some command" where
some command either prints a result (and you process the output) or sets an exit code (and you process $? or somesuch).
According to the "test" manpage (on OS X 10.3):
<pre>
-L file True if file exists and is a symbolic link.
-h file True if file exists and is a symbolic link. This
operator is retained for compatibility with
previous versions of this program. Do not rely on
its existence; use -L instead.
</pre>