Made build.sh portable. Don't rely on GNU extensions