Assuming that neither the path you want to replace nor the replacement path contain any characters that are special in a regular express AND that the path you want to replace is the some number of initial directories in pathnames to be replaced (not an entire pathname), the following simple sed script should work:
pattern="/fldrA/fldrBaf/fldrCaa"
NewDir="/replacement/directory"
sed "s|$pattern/|$NewDir/|g" file
I am looking for selective pattern matching for path at any place in a line. I know how to replace it with a second path variable.
I do not know what paths come in source file, that is what I need to find..
This is my source file, where I need to find paths and replace them with new paths.