Determine OS from a single command line operation

后端 未结 3 1909
粉色の甜心
粉色の甜心 2021-01-28 05:59

Introduction:

I have a \'magic\' tool that can perform a command line operation on a machine if I provide the IP. The tool knows the OS that machine is

3条回答
  •  闹比i
    闹比i (楼主)
    2021-01-28 06:39

    If I understood your problem correctly, then uname is the ideal command. If it's any Unix-system (including OSX), it'll return the correct variable, and if it's Windows it'll return command not found or similar.

提交回复
热议问题