Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- usage() {
- echo "Usage: $0 [ -s | --server server1,server2 ] [ -t | --time YYYY-mmm-ddTHH:MM:SS ] ..."
- exit 1
- }
- opt=$(getopt --options 's:t:h' --longoptions 'server:,time:,help' -- "$@")
- if (( $? )); then usage; fi
- eval set -- "${opt}"
- while :; do
- case "$1" in
- -s|--server) server="$2"; shift 2; ;;
- -t|--time) time="$2"; shift 2; ;;
- -h|--help) usage; ;;
- --) shift; break; ;;
- *) usage; ;;
- esac
- done
- echo normal "$@"
- echo server "${server}"
- echo time "${time}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement