LoginSignup
2
2

More than 5 years have passed since last update.

.bashrcでのCygwinとMinGWの見分け方

Last updated at Posted at 2012-06-15

CygwinとMinGWでのwhich bashの出力が違うので、それを利用する。
Cygwinだと/usr/bin/bash、MinGWだと/usr/bin/bash.exeと言われるので、

_bash=`which bash`
if [ $_bash = "/usr/bin/bash" ] ; then
  LANG=ja_JP.UTF-8
elif [ $_bash = "/usr/bin/bash.exe" ]; then
  LANG=ja_JP.sjis
  JLESSCHARSET="japanese-sjis"
  OUTPUT_CHARSET=sjis
fi

を記載するとCygwinとMinGWでLANGなどの設定を変えられる。

6/13 17:11追記
コードが微妙に間違ってたので書き直しました

2
2
5

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2