Is there a simple way to determine if bash is running on Windows? Running uname
gives "Linux" which is not correct.
Asked
Active
Viewed 78 times
0

Benjamin W.
- 46,058
- 19
- 106
- 116

Jehandad
- 414
- 4
- 13
1 Answers
0
I have not personally tested this but if [ -d /mnt/C ]
may work.
This is probably a terrible solution

anonman
- 98
- 1
- 8
-
It works because usually Windows has a "C:" drive and in the Ubuntu on Windows, /mnt/C refers to that drive. – anonman Apr 20 '17 at 03:23
-
This is essentially a code-only answer, that's not very helpful in understanding the solution. It promotes cargo-cult programming, and does a lousy job putting the reader in a position to make an educated decision, whether this may or may not solve their problem. Please update your answer. – IInspectable Apr 20 '17 at 08:52