From c5a7b03ff3ca13b9fa14229cc27cc4b2cacd0ebe Mon Sep 17 00:00:00 2001 From: Ankam Ravi Kumar Date: Sat, 16 Jun 2018 17:48:07 +0530 Subject: [PATCH] Create getopts.sh --- getopts.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 getopts.sh diff --git a/getopts.sh b/getopts.sh new file mode 100644 index 0000000..4028ba9 --- /dev/null +++ b/getopts.sh @@ -0,0 +1,20 @@ +#!/bin/bash +#Purpose: Getopts Examples working with arguments +#Version:1.0 +#Created Date: Wed May 30 22:30:51 IST 2018 +#Modified Date: +#WebSite: https://arkit.co.in +#Author: Ankam Ravi Kumar +# START # + +while getopts :a:b: options; do + case $options in + a) ap=$OPTARG;; + b) bo=$OPTARG;; + ?) echo "I Dont know What is $OPTARG is" + esac +done + +echo "Option A = $ap and Option B = $bo" + +# END #