-
Notifications
You must be signed in to change notification settings - Fork 14
/
opencfgs.bash
49 lines (46 loc) · 1.28 KB
/
opencfgs.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
#
# This script sequentially opens the training models of ESP-r.
# It uses the same logic as in the Install script.
# Source and target directories. It should be run from the top
# level of the ESP-r distribution.
HOMEdir=`pwd` # Current directory.
MODdir="${HOMEdir}/models" # Source models directory.
TRAdir="${MODdir}/training" # Source training models.
cd ${MODdir}/
# Get list of cfg files in the training folder.
cfgnames=(`find ./training ./validation -name "*.cfg" -print`)
cfgcount=`find ./training ./validation -name "*.cfg" -print | wc -l`
cfgnum=0
for file in "${cfgnames[@]}"; do
cfgnum=$((${cfgnum} + 1))
printf " -> ${cfgnum}/${cfgcount} (${file})"
echo "Proceed with ${file:2} ?";
YN=none;
while [ "$YN" != "y" ] && [ "$YN" != "n" ] && [ "$YN" != "" ]
do
if [ "$YN" != "none" ]; then
echo " ";
echo "Please answer yes or no (y/n) [y].";
fi
read YN
done
if [ "$YN" = "y" ]; then
prj -file ${file:2}
nedit ${file:2}
fi
echo "Continue?";
YN=none;
while [ "$YN" != "y" ] && [ "$YN" != "n" ] && [ "$YN" != "" ]
do
if [ "$YN" != "none" ]; then
echo " ";
echo "Please answer yes or no (y/n) [y].";
fi
read YN
done
if [ "$YN" = "n" ]; then
echo "Exiting the script.";
exit;
fi
done