source: trunk/LMDZ.COMMON/libf/evolution/deftank/multiple_exec.sh @ 3532

Last change on this file since 3532 was 3456, checked in by jbclement, 2 months ago

PEM:
Cleaning of the adsorption module to make the debugging easier.
JBC

  • Property svn:executable set to *
File size: 836 bytes
Line 
1#!/bin/bash
2############################################################
3### Script to execute multiple scripts in subdirectories ###
4############################################################
5
6# Name of the file to execute in all subdirectories
7script_name="launchPEM.sh"
8#script_name="kill_launchPEM.sh"
9#script_name="clean.sh"
10#script_name="modify_startfi_orbit.sh"
11
12# Name of the template directory to skip
13tempdir_name="Template"
14
15# Traverse all subdirectories, excluding the template
16i=0
17for dir in */; do
18    if [ "$dir" == "$tempdir_name/" ]; then
19        continue
20    fi
21    if [ -f "$dir/$script_name" ]; then
22        echo "Executing $script_name in $dir..."
23        pushd "$dir" > /dev/null
24        ./$script_name
25        popd > /dev/null
26        ((i++))
27    fi
28done
29echo "Everything is executed: $i executions in total!"
30
Note: See TracBrowser for help on using the repository browser.