How do I tell whether my cygwin installation is 32 or 64 bit?

前端 未结 4 577
北荒
北荒 2021-02-05 00:09

How do I tell whether my cygwin installation is 32 or 64 bit? I don\'t remember which setup.exe to download. And I would hate to mess up my cygwin installation.

4条回答
  •  我在风中等你
    2021-02-05 00:37

    The other answers address the OP's question, but if you're like me and use both flavors of Cygwin, it's useful to know which one you're using for more than just running setup.exe. If I know my script is running on Cygwin, I prefer

    uname -m
    

    because it gives me only "x86_64" or "i686" as output. I can use that in an "if" block like this:

    if [ $(uname -m) == "x86_64" ]; then do something; fi
    

    Of course, you can also use "uname -a" with "grep" in an if statement. It's a matter of personal preference.

提交回复
热议问题