summaryrefslogtreecommitdiffstats
path: root/flag_arg.sh
blob: 950094a3f5326d6ec7c500c9dd2f11421c8b0356 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

VFLAG="off"
for arg in $@
    do
        case "$arg" in
            -v)
            VFLAG="on"
            ;;
        esac
    done

if [[ $VFLAG == "on" ]]; then
    echo "received $# arguments"
fi