Is there a way to detect OS in fish shell akin to the OSTYPE variable in bash?

巧了我就是萌 提交于 2019-12-05 03:06:25

From the fish user documentation it seems that the canonical way to execute code conditionally depending on the operating system type is using a switch statement with the uname results. See example:

switch (uname)
    case Linux
            echo Hi Tux!
    case Darwin
            echo Hi Hexley!
    case FreeBSD NetBSD DragonFly
            echo Hi Beastie!
    case '*'
            echo Hi, stranger!
end
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!