title: How can I identify the current terminal emulator from a bash script?
body: <p>I've got a script that will open a new tab in the OS X Terminal application and I'm trying to add support for iTerm2.  Unfortunately, the methods to open tabs in the two terminal emulators are different.  </p>
  
  <p>How could I tell which of the two is being used, or is open, to conditionally run the correct script?</p>