I have a bash script in which I want to check if a flag with value was passed to it and then use the value in a variable. Something like this (pseudocode):
file.sh -c 1.0.0
inside file.sh :
#!/bin/bash
get flag:
if flag 'c' then
curl c
else
curl 'something else'
Whats the most optimal way to do the above?