Given the following input stream: txt1.txt atxt.txt txtB.txt
Which of the following regular expressions turns this input stream into the following output stream? txt1.bak.txt atxt.bak.txt txtB.bak.txt
A. s/^.txt/.bak/
B. s/txt/bak.txt/
C. s/txt$/bak.txt/
D. s/^txt$/.bak^/
E. s/[.txt]/.bak$1/
[root]# cat bak
txt1.txt
atxt.txt
txtb.txt
[root]# sed s/txt$/bak.txt/ bak
txt1.bak.txt
atxt.bak.txt
txtb.bak.txt
Correct answer is C
[root]#
sed ‘s/\.txt/\.bak\.txt/g’
The correct answer is ‘s/\.txt/\.bak\.txt/g’