forked from bugy/script-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparameterized.sh
More file actions
executable file
·56 lines (45 loc) · 857 Bytes
/
Copy pathparameterized.sh
File metadata and controls
executable file
·56 lines (45 loc) · 857 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
args=("$@")
echo $@
my_file=''
recurs_file=''
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
--file_upload)
my_file="$2"
shift # past argument
shift # past value
;;
--recurs_file)
recurs_file="$2"
shift # past argument
shift # past value
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
echo
echo 'Arguments:'
printf '%s\n' "${args[@]}"
echo
if [ ! -z "$recurs_file" ]; then
echo "recurs_file="`md5sum "$recurs_file"`
fi
echo
if [ -z "$my_file" ]; then
echo '--file_upload is empty'
else
echo "--file_upload: "`md5sum "$my_file"`
fi
echo
echo 'Environment variables:'
echo 'Req_Text='"$Req_Text"
printenv | grep -P '^PARAM_'
sleep 5