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: 

  


 

posted @ 2022-03-17 09:18  zhuang6  阅读(15)  评论(0)    收藏  举报