Skip to content

Instantly share code, notes, and snippets.

@riywo
Created January 7, 2012 04:52
Show Gist options
  • Save riywo/1573832 to your computer and use it in GitHub Desktop.
Save riywo/1573832 to your computer and use it in GitHub Desktop.
OSのタイプをなんとなく出力
#!/bin/sh
if [ $OSTYPE = "linux-gnu" ]; then
LSB_ID=`lsb_release -i | cut -f2 -d:`
LSB_VERSION=`lsb_release -r | cut -f2 -d:`
OS_VERSION=`echo $LSB_ID-$LSB_VERSION | sed -e "s/ //g"`
MACHINE_TYPE=`uname -m`
echo $OS_VERSION-$MACHINE_TYPE
else
echo `uname -rsm | sed -e "s/ /-/g"`
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment