I need to do find and replace, but the pattern is not full known.
for example,
my file has /proj/app-d1/sun or /data/site-d1/conf
here app-d1 and site-d1 is not constant. It may be different in different files. common part is /proj/xx/sun and /data/xxx/conf
i want to find where ever /proj/xxx/sun or /data/xxx/conf present and replace it with the path value i desire which i have constant values. please suggest how to do this.
Below is the one line which has the patterns to find, i want to replace it with differnt path. here cesite1-d1 is not constant, it may be different in other files.
if [ -f /data/cesite1-d1/conf/source.txt]; then . /data/cesite1-d1/conf/source.txt; fi