给我写一个shell脚本针对不同linux发行版调用不同的安装命令安装make和gcc
#!/bin/bash
check the Linux distribution
if command -v yum >/dev/null 2>&1; then # CentOS/RHEL sudo yum install -y make gcc elif command -v apt-get >/dev/null 2>&1; then # Debian/Ubuntu sudo apt-get update sudo apt-get install -y make gcc elif command -v zypper >/dev/null 2>&1; then # openSUSE sudo zypper install -y make gcc else echo "Unsupported Linux distribution" exit 1 fi
echo "make and gcc are installed successfully"
原文地址: https://www.cveoy.top/t/topic/fq2F 著作权归作者所有。请勿转载和采集!