Hi,
I have to assign a value for a varaiable based on a Input. I have written the below code:
if [ "$procnam" == "admission" ]
then
nf=65
elif [ "$procnam" == "reporting" ]
then
nf=46
elif [ "$procnam" == "transfer" ]
then
nf=164
elif [ "$procnam" == "diagnosis" ]
then
nf=545
elif [ "$procnam" == "emergeny" ]
then
nf=56
elif [ "$procnam" == "inpatient" ]
then
nf=37
else
exit 0
fi
Can someone give me an idea of how to optimize it/make this short?
Also, what should be done to do a incase-sensivite comparison?
Like,
if [ "$procnam" == "Admission" ]
then
nf=65
elif [ "$procnam" == "REPORTING" ]
then
nf=46
...
fi
:rolleyes: