P
P
pqgg7nwkd42017-05-22 21:37:45
linux
pqgg7nwkd4, 2017-05-22 21:37:45

How to run a script in all subfolders?

Good afternoon.
If the folder structure is something like this:

-robot_01
  |-start
  '-stop
-robot_02
  |-start
  '-stop
-robot_02
  |-start
  '-stop
-start_all
-stop_all

Can you please tell me what to write in start_all and stop_all so that when they are launched, the script goes into each subfolder (only 1 level) and runs the corresponding script in it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fat Lorrie, 2017-05-22
@Free_ze

find ./robot_* -maxdepth 0 -type d -exec {}/start \;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question