シェルで論理演算 ref: http://qiita.com/items/cd6aed0813464a15262d