I have the following variable PARM1= APP and the value assigned to it is given in the following PARM, PARM2 = RL. If the user makes a mistake and sends a value of PARM2=-RL, the program fails. How can I do so that once I receive the values if it is wrong I can correct it, that is, if I receive PARM2= -RL in my code PARM2= RL is used
I tried the following code but sed seems to be misconfigured
if [ "$PARM3" = -RL ];
then
sed -i -e 's/-RL/RL/g'
elif [ "$PARM3" = -RS ];
then
sed -i -e 's/-RS/RS/g'
fi