Skip to content
Advertisement

Find and Execute Scripts in Subdirectories

I have a filesystem structured like this:

  • Parent Directory
    • orchestrator
      • init.sh
    • Subdir1
      • install.sh
    • Subdir2
      • install.sh
    • Subdir3
      • install.sh

Within the init.sh, I have:

JavaScript

This works for the most part, but it is fragile. If one of the install.sh scripts encounters a problem, the init.sh script stops. I’d like for it to continue on to the next install.sh script if this happens. But I’m not sure how to get that to work.

Advertisement

Answer

Replacing sh -c "${installer}" with sh -c "${installer} || true" should work, since true always returns 0.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement