Newer
Older
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
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
## Simple script to output a unified file name based on a set of data options
EBEAM=
PBEAM=
DECAY=
CONFIG=
TYPE=
while [ $# -gt 0 ]; do
key=$1
case $key in
--ebeam)
EBEAM="$2"
shift
shift
;;
--pbeam)
PBEAM="$2"
shift
shift
;;
--decay)
DECAY="$2"
shift
shift
;;
--config)
CONFIG="$2"
shift
shift
;;
--stage)
TYPE="$2"
shift
shift
;;
*)
echo "Unknown option $key to print_fname, aborting..."
exit 1
esac
done
if [ -z $EBEAM ]; then
echo "EBEAM not defined in print_fname, aborting..."
exit 1
elif [ -z $PBEAM ]; then
echo "PBEAM not defined in print_fname, aborting..."
exit 1
elif [ -z $DECAY ]; then
echo "DECAY not defined in print_fname, aborting..."
exit 1
elif [ -z $CONFIG ]; then
echo "CONFIG not defined in print_fname, aborting..."
elif [ -z $TYPE ]; then
echo "TYPE not defined in print_fname, aborting..."
fi
echo "${CONFIG}_${DECAY}-${EBEAM}on${PBEAM}-${TYPE}"