Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 3
    Did you run the script through shellcheck.net? It contains typos. Commented May 27, 2021 at 19:12
  • 1
    Does this answer your question? How to execute multiple commands remotely on few servers? Commented May 28, 2021 at 1:43
  • As an aside, cd $dir; rm $file is a dangerous antipattern. Use && to do the rm only if the cd succeeded. Commented May 31, 2021 at 14:01