summaryrefslogtreecommitdiff
path: root/harmoneff/alle_harmoneff
blob: 6f6336f8af1ef8af9cb46636bef90148928b8025 (plain)
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
#!/bin/sh
# usage: ./alle_harmoneff output "whatever needs the harmoneff after the filename(s)" file1 file2 ...

if [ -e "$1" ]
then
  echo "$1 existiert bereits! Ueberschreiben (u/j), anhaengen (a/n) oder abbrechen?"
  read was
  if [ "$was" != "u" ] && [ "$was" != "j" ] && [ "$was" != "a" ] && [ "$was" != "n" ]
  then
    echo "Okay, abbrechen!"
    exit 0
  fi
  if [ "$was" == "u" ] || [ "$was" == "j" ]
  then
    echo "Okay, ueberschreiben!"
    rm "$1"
  else
    echo "Okay, anhaengen!"
  fi
fi

inputs[0]=""
for t in $*
do
  if [ "$t" != "$1" ] && [ "$t" != "$2" ]
  then
    for s in $(./sammle_inputfiles $t)
    do
      inputs[${#inputs[*]}]=$s
    done
  fi
done

for ((i=0; i<${#inputs[*]}; i++))
do
  s=${inputs[$i]}
  ./harmoneff $1 $s $2
done