I have a shell script and in it I need to replace some text in a path.
The replacement will be the third value between /
Replace with /opt/20150422_ABC/DBC/10/82/filename.txt
Not sure what the replacement would be.
CC=`echo $AA | sed 's@/\(.*\)/\(.*\)/\(.*\)/(.*)@/\1/\2/'$BB'\4@g'`
The code for the sed is not working and get the following
It needs to be /opt/20150422_ABC/DBC/10/82/filename.txt