My favourite pattern for this use-case is to write script A that generates script B; instead of A invoking &#x27;rm&#x27; directly, it runs &#x27;echo rm&#x27;, or even &#x27;echo #rm&#x27;.<p>Then I open up script B in an editor and review the planned changes. Once I like what I see (potentially after a few edits) I run &#x27;bash B&#x27;.