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… :)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login