Could someone help me to call a shell script with named parameters.
I mean
Callscript .sh -c someconfigfile.txt
or
callscript.sh -config someconfigfile.txt
inside the script how can I retrieve someconfigfile.txt using the parametername -c or -config.
Thanks.
You need to use getopts. Usually you can type man getopts to get some information, or search the web for examples.
Thank you. I could retrieve the parameter value using the piece of code below.
while getopts c: option
do
case $option in
c)
Config_File=$OPTARG
;;
esac
done
echo $Config_File