removing all bashism too much hassle, make script bash-only