Rewrite leaf in bash