extracting string and add value to it : I have string like 1001.2001.3001.5001.6001 or 1001-2001-3001-5001-6001. In this how to extract 4th string i.e., 5001, add value like 121 to it and put it back in the same string. The output should be like 1001.2001.3001.5122.6001 or 1001-2001-3001-5122-6001. I have to achieve this in linux bash scripting

thanks