This works fine:
sed -i 's# @driver.find_element(:xpath, "//a\[contains(@href,##' temp_spec.rb against a source of
@driver.find_element(:xpath, "//a[contains(@href,'change_district')]").click I am just left with:
'change_district')]").click` but when I try to add a single quote at the end it fails:
sed -i 's# @driver.find_element(:xpath, "//a\[contains(@href,\'##' temp_spec.rb syntax error near unexpected token `(' I am using \' to escape the single quote.
Note that I am using a # as a delimiter instead of the normal / delimiter as there are /'s in the text.