fix bug when run 'bash -x brew' under dir where brew script in.

just like brew script in  ~/homebrew/bin,  run $cd ~/homebrew/bin && bash -x brew or sh brew,
then ${0%/*} get wrong path.