Skip to content

Instantly share code, notes, and snippets.

@mpapis
Created September 3, 2013 06:37
Show Gist options
  • Select an option

  • Save mpapis/6420355 to your computer and use it in GitHub Desktop.

Select an option

Save mpapis/6420355 to your computer and use it in GitHub Desktop.
detect_os()
{
if [[ -n "${platform:-}" ]]
then return 0
fi
platform=...
}
# will run detection only once (not 4)
detect_os
detect_os
detect_os
detect_os
echo $platform
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment