#!/bin/sh

a=`uname  -a`

b="Darwin"
c="centos"
d="ubuntu"

if [[ $a =~ $b ]];then
    echo "mac"
elif [[ $a =~ $c ]];then
    echo "centos"
elif [[ $a =~ $d ]];then
    echo "ubuntu"
else
    echo $a
fi

 

相关文章:

  • 2021-08-29
  • 2021-10-15
  • 2022-02-26
  • 2021-06-25
  • 2021-08-23
  • 2022-01-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2021-06-28
  • 2021-06-03
相关资源
相似解决方案