Which of the following regular expressions turns this input stream into the following output stream?

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/

Download Printable PDF. VALID exam to help you PASS.

3 thoughts on “Which of the following regular expressions turns this input stream into the following output stream?

  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]#

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.