shell 案例
目录
shell 获取当前系统
shell 获取当前系统
#!/bin/bash
get_os(){
system=`sed -n '1p' /etc/os-release |cut -d "\"" -f 2 |cut -d "\"" -f 1 |cut -d " " -f 1 |cut -d "=" -f 2`
if [[ $system == "Ubuntu" ]]; then
echo $system
elif [[ $system == "Red" ]]; then
echo $system
elif [[ $system == "CentOS" ]]; then
echo $system
elif [[ $system == "ChromeOS" ]]; then
echo $system
else
echo $system
fi
}
shell 中安装系统
shell> FSO:

浙公网安备 33010602011771号