Switch bashrc settings for Cygwin or MinGW


via

.bashrcでのCygwinとMinGWの見分け方 #Bash - Qiita

~/.bashrc

c.f. https://gist.github.com/2942330#file_.bashrc

~/.bashrc
sysname=`uname -s | sed -e "s/\([a-zA-Z]\+\).*/\1/"`
if [ "$sysname" = "CYGWIN" ]; then
    LANG=ja_JP.UTF-8
elif [ "$sysname" = "MINGW" ]; then
    LANG=ja_JP.sjis
    JLESSCHARSET="japanese-sjis"
    OUTPUT_CHARSET=sjis
fi

whereami (Simulate 'uname -o')

c.f. https://gist.github.com/2942330#file_whereami

whereami
#!/usr/bin/bash
sysname=`uname -s | sed -e "s/\([a-zA-Z]\+\).*/\1/"`
echo $sysname