[[ ]] は bashの機能!

わざわざtestしなくても mkdir hoge 2> /dev/null でいいよ。
test方式だとクリティカルパスになるから不完全だし。