Avoid bash way, improve posix shell portability