How to detect windows OS in shell script
By Joseph Russell •
I would like to write a cross-platform script using shell so I can run it on linux, mac os and windows. I'm using cygwin on windows to make this possible. However, there are some custom commands that I need to execute on windows only. Is there a way to detect if the shell if running on windows in shell script? Thanks!
1 Answer
You can parse the output of the uname command to determine the underlying OS.