面试题答案
一键面试#!/bin/bash
os_type=$(uname -s)
if [ "$os_type" == "Linux" ]; then
echo "This is Linux, execute Linux - specific code here"
# 在这里添加 Linux 特定的代码
elif [ "$os_type" == "Darwin" ]; then
echo "This is macOS, execute macOS - specific code here"
# 在这里添加 macOS 特定的代码
else
echo "Unsupported operating system"
fi