summaryrefslogtreecommitdiffstats
path: root/flag_arg.sh
diff options
context:
space:
mode:
authorKyle K <kylek389@gmail.com>2012-05-26 00:22:05 -0500
committerKamil Kaminski <kyle@kkaminsk.com>2012-05-26 00:22:05 -0500
commit5c961dc755954d1a2f90248c81aff725cf38466c (patch)
tree73aebdd6101d798355149d6499186ef9a2ef866b /flag_arg.sh
downloadscripts-5c961dc755954d1a2f90248c81aff725cf38466c.tar.gz
scripts-5c961dc755954d1a2f90248c81aff725cf38466c.tar.bz2
scripts-5c961dc755954d1a2f90248c81aff725cf38466c.zip
initial commit
Diffstat (limited to 'flag_arg.sh')
-rwxr-xr-xflag_arg.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/flag_arg.sh b/flag_arg.sh
new file mode 100755
index 0000000..950094a
--- /dev/null
+++ b/flag_arg.sh
@@ -0,0 +1,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
+