How to know if a shell script is writtend in bash or sh?

view full story

http://unix.stackexchange.com – How may I know if a script is either written in bash or sh? The first line of the script mean nothing, since on Linux, bash script has this line: #!bin/sh Actually, there are many distribution where bin/sh is bash (maybe a bin/sh is a link to bin/bash in those distro), and not bourn shell. So if I try to run such script, that are written in bash, in for example, FreeBSD, the result is not defined, since bin/sh in FreeBSD is bourn shell, and not bash. Is there are easy way to identify if either a script is bash or sh? Any some distinctive thing in syntax? (HowTos)