VALUE="+ABC+DEF+MGH+THY+MGH+hjk+fyf"
count=0
no_fields=`echo "$VALUE" |awk -F"+" '{print NF}' `
no_fields=`expr $no_fields - 1`
echo "The number of + are $no_fields"
The initial string is like this
+abc+def+ghj+jkl+asd
Please note the + in the beginning also. i am having the whole string in a variable called VALUE and i want the new value of the varaiable to be
abc, def, ghj, jkl, asd
i.e removing starting + and repacing with ,<space> elsewhere with new string to be placed in the same varaiable.