Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tool.sh <file-to-use>
- tool.sh <file-to-use> -o <output-file-name>
- # If arguments are set and equals "-o" then set APP_NAME
- if [[ -n $3 ]] && [[ $2 = "-o" ]]; then
- APP_NAME=$3
- # If argument is set and equals anything besides "-o" throw error and show help menu
- elif [[ -n $2 ]] && [[ $2 != "-o" ]]; then
- echo "ERROR: Synatx error."
- bash $0 -h
- exit
- # If "-o" is set but they did not give a output name throw error and display help menu
- elif [[ -z $3 ]] && [[ $2 = "-o" ]]; then
- echo "ERROR: Did not specify output file name."
- bash $0 -h
- exit
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement