made bash scripts generate and use internal id