Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- while [[ $# > 1 ]]
- do
- key="$1"
- case $key in
- -i|--input)
- shift
- INPUT="$1"
- ;;
- -d|--dir)
- shift
- DIR="$1"
- ;;
- *)
- ;;
- esac
- shift
- done
- if [[ -z "${INPUT}" ]]; then
- echo "Please input a number:"
- read INPUT
- fi
- if [[ -z "${DIR}" ]]; then
- DIR="$( cd "$( dirname "$0" )" && pwd )"
- DIR="$( dirname "$DIR" )"
- fi
- # do something
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement