Avoiding subshells to make the script more portable