-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathunzip.bash
60 lines (53 loc) · 892 Bytes
/
unzip.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
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
usage() {
echo "Usage: $0 [-fq1/-fastq1]
[-fq1/-fastq2]
[-nm1/-normal1]
[-nm2/-normal2]" 1>&2
}
exit_abnormal_code() {
echo "$1" 1>&2
exit $2
}
exit_abnormal_usage() {
echo "$1" 1>&2
usage
exit 1
}
exit_abnormal() {
usage
exit 1
}
while [ -n "$1" ]; do
case "$1" in
-fastq1 | -fq1)
fastq1="$2"
echo "The value provided for fastq1 is $fastq1"
shift
;;
-fastq1 | -fq2)
fastq2="$2"
echo "The value provided for fastq2 is $fastq2"
shift
;;
-normal1 | -nm1)
normal1="$2"
echo "The value provided for normal1 is $normal1"
shift
;;
-normal2 | -nm2)
normal2="$2"
echo "The value provided for normal2 is $normal2"
shift
;;
*)
exit_abnormal_usage "Error: invalid parameter \"$1\"."
shift
;;
esac
shift
done
gunzip $fastq1
gunzip $fastq2
gunzip $normal1
gunzip $normal2