bash: some fixed for Mac