I'm making a bash script. My custom bashrc, to be more precise. And I need to have separate configs, depending on what "Linux" I am in (the Windows 10 Linux subsystem or actual Linux).
How can I tell them apart?
Things I tried:
$OSTYPE- both returnlinux-gnuuname -a- both return similarLinux COMPUTER_NAME_HERE 3.4.0+ #1 PREEMPT Thu Aug 1 17:06:05 CST 2013 x86_64 x86_64 x86_64 GNU/Linuxlsb_release -a- both returnubuntu xx.xxcat /etc/issue.net- both returnUbuntu 14.04.4 LTSld -v- both returnGNU ld (GNU Binutils for Ubuntu) 2.24
The only way I have found to make this work is to set some specific username for the Windows sub-system, and use $USER, but that is not an option I'm willing to use. I need this to work out of the box, without custom user names, environment variables, etc..
c:/exists, and./c:/does not.