Skip to content

Instantly share code, notes, and snippets.

@siwells
Created August 4, 2011 16:27
Show Gist options
  • Save siwells/1125564 to your computer and use it in GitHub Desktop.
Save siwells/1125564 to your computer and use it in GitHub Desktop.
Determine the kernel that the host is running & output an appropriate message
#!/bin/bash
OS=`uname -s`
if [ "$OS" == "Darwin" ]; then
echo "Mac OS X with Darwin Kernel"
elif [ "$OS" == "Linux" ]; then
echo "GNU/Linux OS with Linux Kernel"
else
echo "Not Mac or Linux"
fi
@liangyuanxi
Copy link

!/bin/bash

OS=uname -s

if [ "$OS" == "Darwin" ]; then
echo "Mac OS X with Darwin Kernel"
elif [ "$OS" == "Linux" ]; then
echo "GNU/Linux OS with Linux Kernel"
else
echo "Not Mac or Linux"
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment