While do statement with replacement

Hi Folks -

I have a process where I need to check if cold2 from my while do command contains either a / or ".

If / is found, replace with //
If " is found, replace with ""

I have this so far and I've been unable to get sed to work:

while IFS=, read col1 col2
do
    if [ "$col2" == *\/* ]
    then
    echo "$col2" | sed "s/\//\/\//g"
    echo . ${_STARTMAXLPATH} ${_MAXLSCRIPTPATH}Update_Subvars.mxl ${_ESSB_USER} ${_ESSB_PSWD} ${_ESSB_SRVR} $col1 $col2 ${_MAXLLOGFILE}
    elif [ "$col2" == *\"* ]
    echo "$col2" | sed "s/\"/\"\"/g"
    echo . ${_STARTMAXLPATH} ${_MAXLSCRIPTPATH}Update_Subvars.mxl ${_ESSB_USER} ${_ESSB_PSWD} ${_ESSB_SRVR} $col1 $col2 ${_MAXLLOGFILE}
    fi

done <${_SUBVARPATH}${_YEAR}_${_MONTH}${_DAY}/Subvar_List.txt

Thanks!

Single bracket test matches strings not patterns. Use a case statement which allows pattern matching.

case $col2 in
    */*)   do stuff
             do more stuff
             ;;

    *\"*)  do stuff
              do more stuff
             ;;
esac