-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuntarCards.sh
More file actions
executable file
·40 lines (34 loc) · 971 Bytes
/
Copy pathuntarCards.sh
File metadata and controls
executable file
·40 lines (34 loc) · 971 Bytes
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
#!/bin/sh
######################################################
# Extracts the input cards from a Madgraph gridpack #
# #
# Author: A. Mecca ([email protected]) #
######################################################
show_help(){ cat <<EOF
Usage: ${0##*/} [-o DIR] GRIDPACK"
Extract the datacards from GRIDPACK
-o DIR ourput the cards in DIR
EOF
}
OPTIND=1
while getopts "ho:" opt; do
case $opt in
h)
show_help
exit 0
;;
o)
outdir=$OPTARG
;;
*)
show_help >&2
exit 1
;;
esac
done
shift "$((OPTIND-1))"
[ -z ${outdir:+x} ] || cd $outdir
[ $# -eq 1 ] || { echo "Error: specify exactly 1 argument (path to tarball)" 2>&1 ; exit 1 ;}
membername=$(tar -ta -f $1 | grep InputCards)
tar -xa -f $1 $membername
# tar -xa -f $1 InputCards || tar -xa -f $1 ./InputCards