Linux/Unix系统通用的Shell脚本中区分平台的一个方法
时间:2007-03-27 来源:icymoon
#!/bin/ksh
PLATFORM=`uname`
#AIX
if [[ "$PLATFORM" = "AIX" ]]; then
function_aix
fi
#Solaris
if [[ "$PLATFORM" = "SunOS" ]]; then
function_sunos
fi
#Linux
if [[ "$PLATFORM" = "Linux" ]]; then
function_linux
fi
#...
PLATFORM=`uname`
#AIX
if [[ "$PLATFORM" = "AIX" ]]; then
function_aix
fi
#Solaris
if [[ "$PLATFORM" = "SunOS" ]]; then
function_sunos
fi
#Linux
if [[ "$PLATFORM" = "Linux" ]]; then
function_linux
fi
#...
相关阅读 更多 +