bash - 查看安装脚本是否在 mac 或 linux 机器上运行

标签 bash shell

我想知道我的安装脚本是在 Mac 还是 Linux 设备上运行。

有人可以给我提示吗?

最佳答案

检查 uname 程序。在 linux 上 uname 返回“Linux”,在 Leopard 上它返回“Darwin”

关于bash - 查看安装脚本是否在 mac 或 linux 机器上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1923550/

相关文章:

bash - 以其他用户身份运行时,bashrc 文件中的导出变量不可见

linux - Webapp更新shell脚本

shell - 测试 POSIX shell 合规性?

c - setuid(0) 无法为 root 拥有的程序执行

linux -/etc/passwd 上是否存在所有 linux 用户?

git - bashrc 别名,不要混淆 git 和 mercurial

python - 使用函数重命名文件

linux - 如果文件中不存在数组元素需要将其打印为数组元素为零

linux - 将正在运行的程序的输出重定向到可以分析的文件中

linux - bash脚本获取脚本的绝对目录