I have written a very simple script which takes a string as input and replace the input text in a file via sed. But I get an error always
sed: -e expression #1, char 40: unknown option to `s'
Shell script is as below
sed -i "s/c9/$1/g" Test.java
and to run
./code.sh "lmc.driver.findElement(By.xpath(\"//*[@id=\\\"login-email\\\"]\")).clear();\n lmc.driver.findElement(By.xpath(\"//*[@id=\\\"login-email\\\"]\")).sendKeys(username);\n lmc.driver.findElement(By.xpath(\"//*[@id=\\\"login-password\\\"]\")).clear();\n lmc.driver.findElement(By.xpath(\"//*[@id=\\\"login-password\\\"]\")).sendKeys(password);\n lmc.driver.findElement(By.xpath(\"//*[@id=\\\"loginForm\\\"]/div[3]\")).click();\n lmc.driver.findElement(By.xpath(\"//*[@id=\\\"login-identity-domain\\\"]\")).clear();\n lmc.driver.findElement(By.xpath(\"//*[@id=\\\"login-identity-domain\\\"]\")).sendKeys(tenantId);\n
lmc.driver.findElement(By.xpath(\"//*[@id=\\\"loginBtn\\\"]\")).click();"