4 ms·
I stole this from somewhere, but in bash at least you can do something like this: if [ $(uname) = "Darwin" ]; then ... # macos if [ "$TERM" != "cygwin" ] ; th
by aweiland 5y ago
I stole this from somewhere, but in bash at least you can do something like this:
if [ $(uname) = "Darwin" ]; then ... # macos
if [ "$TERM" != "cygwin" ] ; then ... # cygwin
I'm sure there are other ways to determine WSL and others you mentioned.
- barrkel 5y agoOh there are selectors you can run, but what of you want different config files? Different inputrc or dircolors because you use different terminals, etc. And then there's the difficulty in managing an enormous do-everything script, vs something which is compiled for the platform.