I am Having trouble using getopts where i am trying to parsing options but getting error:
Error: File not found with name : -a
Code:
while getopts ":a :b :c :d :e :f :g" opt; do
case $opt in
a) FILETOPARSE=$OPTARG
echo $compactAlarms
;;
b) FILETOPARSE=${OPTARG}
echo $nodeAlarms
;;
c) FILETOPARSE=${OPTARG}
echo $severityAlarms
;;
d) FILETOPARSE=${OPTARG}
echo $csvGentrator
;;
e) FILETOPARSE=${OPTARG}
echo $tableData
;;
f) FILETOPARSE=${OPTARG}
echo $help
;;
g) FILETOPARSE=${OPTARG}
echo $exit_function
;;
*)
echo "Error wrong Syntax,Opening help" && help
;;
esac
done
Once it parses the data it'll call the function and display the data.