rm_: replace basename for shell scripting code