I am new to scripting and stuck at one place that may be really simple.. still would be grateful if anyone can help.
Below is my issue in simplest term:
Input file new.txt
Hello team
Output file expected: new_2.txt
Select '/backup/path1_' from dual;
Select '/backup/path2_' from dual;
Hello team
Note : $var1=path1 and $var2=path2
Sed command used :
Sed '1i\
Select '/backup/"$var1"_' from dual;\
Select '/backup/"$var2"_' from dual;\
' new.txt > new_2.txt
Output received:
new_2.txt
Select /backup/path1_ from dual;
Select /backup/path2_from dual;
Hello team
After various quotes combination also, either single quote ' won't be displayed in output or var value won't be inserted.