Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c5a7b03

Browse files
author
Ankam Ravi Kumar
authored
Create getopts.sh
1 parent 54bb512 commit c5a7b03

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

getopts.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
#Purpose: Getopts Examples working with arguments
3+
#Version:1.0
4+
#Created Date: Wed May 30 22:30:51 IST 2018
5+
#Modified Date:
6+
#WebSite: https://arkit.co.in
7+
#Author: Ankam Ravi Kumar
8+
# START #
9+
10+
while getopts :a:b: options; do
11+
case $options in
12+
a) ap=$OPTARG;;
13+
b) bo=$OPTARG;;
14+
?) echo "I Dont know What is $OPTARG is"
15+
esac
16+
done
17+
18+
echo "Option A = $ap and Option B = $bo"
19+
20+
# END #

0 commit comments

Comments
 (0)