Deduplicated  from
Corrected the script to execute in Bash