Shammer's Philosophy

My private adversaria

${OSTYPE} returns blank

I understood that SHELL value OSTYPE returns the platform indicating current operating system. Then, I used this in my shell script but $OSTYPE always blank in my shell script even if $OSTYPE has a not blank value in Terminal.
My script includes like following case sentences but it doesn't work I expected.

case "${OSTYPE}" in
    linux*)
        echo "Linux"
        .....
        ;;
    darwin*)
        echo "Mac OS X"
        .....
    ;;
    *)
        echo "No matching, OSTYPE is ${OSTYPE}"
esac

In terminal, "echo ${OSTYPE}" returns linux-gnu but above script doesn't work as I expected. I will rewrite using uname result instead of ${OSTYPE}.