#!/bin/bash

判断系统类型

if [ "$(uname)" == "Linux" ]; then # Linux系统 sudo apt-get update sudo apt-get install make gcc elif [ "$(uname)" == "Darwin" ]; then # macOS系统 brew update brew install make gcc else echo "Unsupported system type: $(uname)" exit 1 fi

echo "make and gcc installed successfully!"

给我写一个shell脚本判断系统的类型不同系统调用不同的安装命令安装make和gcc

原文地址: https://www.cveoy.top/t/topic/fq2z 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录