#!/usr/app/TurboShell/bin/bash
usage() {
  echo "użycie: 22-options.sh [-l LIMIT] [-q] NAZWA"
  exit 2
}

limit=90 quiet=no
while getopts 'l:q' option; do
  case $option in
    l) limit=$OPTARG ;;
    q) quiet=yes ;;
    *) usage ;;
  esac
done
shift $((OPTIND - 1))
(($# == 1)) || usage
[[ $limit =~ ^[1-9][0-9]?$ ]] || usage

used=93
[[ $quiet == yes ]] || echo "$1: zajęte $used procent, limit $limit"
((used < limit))
