compute/bash-skeleton.md
... ...
@@ -16,6 +16,11 @@ info() {
16 16
echo "$0: INFO: $1" >&2
17 17
}
18 18
19
+usage() {
20
+ echo "Usage: $0 -p|-s|-t -u <user> file [file] ..." >&2
21
+ exit 1
22
+}
23
+
19 24
while getopts ':hpstu:' opt; do
20 25
case $opt in
21 26
p)
... ...
@@ -31,8 +36,7 @@ while getopts ':hpstu:' opt; do
31 36
RUSER="$OPTARG"
32 37
;;
33 38
\?|h)
34
- echo "$0 -p|-s|-t -u <user> file [file] ..."
35
- exit 1
39
+ usage
36 40
;;
37 41
esac
38 42
done