Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #set "default" parameter
- query=""
- while [ "$1" != "" ]; do
- case $1 in
- -q | --query ) shift
- query=$1
- ;;
- esac
- shift
- done
- #query cannot be empty
- if (($query == ""))
- then
- echo 'no query'
- exit
- fi
- echo "query - $query"
- ./script.sh -q request
- query - request
- ./script.sh -q
- ./script.sh
- ./main.sh: line 13: ((: == : syntax error: operand expected (error token is "== ")
- query -
- if [ "$query" == "" ]
- if [ -z "$query" ]
Add Comment
Please, Sign In to add comment