---
title: "solaris,linux,aix,输出操作系统标识；即 自动识别操作系统，"
author: "gmleegmlee"
date: "2011-11-04T10:21:14Z"
tags: []
categories: ["操作系统"]
slug: "solaris-linux-aix"
draft: false
lastmod: "2011-11-04T10:21:14Z"
id: 1234902
url: "https://gmleegmlee.iteye.com/blog/1234902"
---

```java


OSNAME=`uname`
echo $OSNAME
if [ $osname = "Linux" ] ; then
    JAVA_HOME=`cd "$UMS_HOME"/jdk/jdk/linux/; pwd`
fi

if [ $osname = "SunOS" ] ; then
    JAVA_HOME=`cd "$UMS_HOME"/jdk/jdk/solaris/; pwd`
fi

if [ $osname = "AIX" ] ; then
    JAVA_HOME=`cd "$UMS_HOME"/jdk/jdk/aix/; pwd`
fi




```