#!/bin/bash VFLAG="off" for arg in $@ do case "$arg" in -v) VFLAG="on" ;; esac done if [[ $VFLAG == "on" ]]; then echo "received $# arguments" fi