title: How to check if running in Cygwin, Mac or Linux?
body: <p>I have a shell script that is used both on Windows/Cygwin and Mac and Linux. It needs slightly  different variables for each versions.</p>
  
  <p>How can a shell/bash script detect whether it is running in Cygwin, on a Mac or in Linux?</p>