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
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
The regular expression that correctly transforms the input stream into the desired output stream is s/txt$/bak.txt/. This expression searches for the string 'txt' only at the end of the lines and replaces it with 'bak.txt'. The other options either do not match the pattern only at the end of the line, or they use incorrect syntax, making them unsuitable for producing the intended output.
correct \/ In my opinion the correct option is s / txt $ / bak.txt /
In my opinion the correct option is s / txt $ / bak.txt /
s/txt$/bak.txt/ replaces the string txt with bak.txt at the end of the line. Globally is nonsense, since there is only one “txt at the end of the line” in any line. Memorize B for your test. After passing the test, forget B and realize that the answer C is the correct one. Life is tough.
C is the Correct Answer
/var/root # cat teste | sed s/txt$/bak.txt/ txt1.bak.txt atxt.bak.txt txtb.bak.txt /var/root # cat teste | sed s/txt/bak.txt/ bak.txt1.txt abak.txt.txt bak.txtb.txt C is the right
C because $ will change the only "txt" at the end of the line. If there is no $ symbol the command will change the first part of the name of the first file too.
C check todoist
sed s/txt$/bak.txt/ <<TXT > txt1.txt > atxt.txt > txtB.txt > TXT answer is C
answer is C
aswer must be C
answer is C
I think b is the correct answer. The only option that is missing is the g at the end. /txt/ wil search for exactly that word, and will change it to /bak.txt/,
B makes the most sense to me. Adding the $ just unnecessarily complicates things.
text inside file: txt1.txt atxt.txt txtB.txt cat file | sed 's/txt/bak.txt/' bak.txt1.txt abak.txt.txt bak.txtB.txt I am doing something wrong?
C 100%
Correct is C
Answer: C