-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecute.sh
More file actions
executable file
·36 lines (32 loc) · 785 Bytes
/
execute.sh
File metadata and controls
executable file
·36 lines (32 loc) · 785 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
#!/usr/bin/env bash
show_help() {
cat << EOF
Usage: ${0##*/} [-hv] [-f OUTFILE] [FILE]...
Do stuff with FILE and write the result to standard output. With no FILE
or when FILE is -, read standard input.
-h display this help and exit
-f OUTFILE write the result to OUTFILE instead of standard output.
-v verbose mode. Can be used multiple times for increased
verbosity.
EOF
}
COORDINATOR=${1:-1}
WORKERS=${2:-0}
OPTIND=1
while getopts hvf: opt; do
case $opt in
h)
show_help
exit 0
;;
v) verbose=$((verbose+1))
;;
f) output_file=$OPTARG
;;
*)
show_help >&2
exit 1
;;
esac
done
shift "$((OPTIND-1))" # Discard the options and sentinel --