fix compatable problem
1.detect gnu sed and bsd sed
2.in some shell '-' is alias for 'cd -', we will shift the input arg