Currently, I have a command that loops over a list of directories(which I don't know the names of) and then cd
into directory to finally execute a maven install
command. However, I noticed that only one directory holds the pom.xml
. It is unnecessary to run the maven command on those other directories. Is there a way to loop through directories and stop in the one that holds the pom.xml
, then execute the maven command and break out of the loop?
for d in */ ; do (cd "$d" && maven install -Dmaven.test.skip=true); done