mobaxterm下执行uname
查看结果
14934 $ uname
CYGWIN_NT-10.0-WOW
测试test语句,双等号两边没加空格时
周五 2020-06-26 18:49:19 ~
14932 $ test "$(uname)"=="Linux" && echo "linux" || echo "cygwin"
linux
测试test语句,双等号两边加了空格,才能正确判断成功!
周五 2020-06-26 18:50:04 ~
14933 $ test "$(uname)" == "Linux" && echo "linux" || echo "cygwin"
cygwin
网友评论