#!/bin/bash system_version=$( /usr/bin/sw_vers -productVersion ) system_os_major=$( echo "$system_version" | cut -d '.' -f 1 ) echo $system_os_major