Adapt script to comply with POSIX syntax