determine open command in shell script