Script originally inspired by VMS's purge command