mirror of
https://github.com/techarkit/shell-scripting-tutorial.git
synced 2025-07-31 21:09:32 +00:00
Create getopts.sh
This commit is contained in:
20
getopts.sh
Normal file
20
getopts.sh
Normal file
@ -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 #
|
Reference in New Issue
Block a user