Append the values to a text
-
Hi All,
Need a Regex formula for below scenario.
String:
/Var/opt/oracle/test/myfile.txtOutput I want using Regex fomula:
cp -rp /Var/opt/oracle/test/myfile.txt /Var/opt/oracle/test/myfile.txt_${stamp}So basically its copying the whole string twice and prefixing it with "cp -rp " and at the end its appending with “_${stamp}”
Is is possible to implement in Regex? If yes then It would be very helpful.
Thanks in advance,
Nikhil Chavan -
@Nikhil-Chavan said in Append the values to a text:
cp -rp /Var/opt/oracle/test/myfile.txt /Var/opt/oracle/test/myfile.txt_${stamp}
I assume you do have a file with each line being a path to a file,
if so then
find what:^.+$
replace with:cp -rp $0 $0_${stamp}
-
@Ekopalypse Superb!! Thanks alot! It worked… :)