title: Why would this script work on Mac OS and not on Windows using Git Bash?
body: <p>I wrote a site diagnostic script and have been testing it using iTerm2 on MacOS. A good portion of people that may consume this script use Windows and Git Bash (it's probably 50|50 Windows vs Mac OS): so not supporting Windows might not be an option.</p>
  
  <p>I had someone here test out the script on their Windows PC and it immediately failed. Would anyone know why this function would succeed on Mac and fail on Windows?</p>
  
  <pre><code>_ping_test(){
  
    # Define Error Codes &amp; Messages Below:
    local _success="0"
    local _success_message="${_green}SUCCESS:${_reset_color} Ping Test Passed"
    local _unknown_host="68"
    local _unknown_host_message="${_red}ERROR:${_reset_color} Ping Test Failed on ${_url} - Unknown Host"
    local _unrecognized_code="${_red}ERROR:${_reset_color} Ping Test Failed - Unrecognized Status Code${_ping_test} "
  
  
    local _url="${1}.testdomain.net"
    local _ping_url=$(ping -c 1 -q $_url &amp;&gt; /dev/null; echo $?)
  
    if [ "${_ping_url}" == "${_success}" ] ; then
      echo $_success_message
    elif [ "${_ping_url}" == "${_unknown_host}" ] ; then
      echo $_unknown_host_message
      exit 1
    elif true ; then
      echo $_unrecognized_code
      exit 1
    fi
  }
  </code></pre>
  
  <p>Running it returns the Unrecognized Code response on his computer, but given the same site is successful on my Mac.</p>
  
  <p>I echo'd back $_url, and that returns the correct site. I also tried removing the <code>&amp;&gt; /dev/null</code> portion to hear back what the issue was, but it returned that it didn't recognize the command <code>ping</code></p>
  
  <p>Then I just ran the ping command directly in his Git Bash window, and that worked outside of the shell script. </p>
  
  <p>I realize the ping test portion is a bit silly (it's used to exit the script if they input a bad URL), but the more valuable ssh commands that run later were also failing similarly</p>