Is there a simple way to determine if bash is running on Windows? Running uname gives "Linux" which is not correct.
Asked
Active
Viewed 71 times
0
Benjamin W.
- 38,596
- 16
- 96
- 104
Jehandad
- 374
- 3
- 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