PrepAway - Latest Free Exam Questions & Answers

Which command would replace “bob” with “Bob” in all instances and generate a new lette

You have created a really long letter and after you are done, you notice that you used the name "Bob" many times but your forgot to capitalize it in many instances.

Which command would replace "bob" with "Bob" in all instances and generate a new letter for printing?

PrepAway - Latest Free Exam Questions & Answers

A.
sed ‘/bob/Bob’ letter > newletter

B.
sed s/bob/Bob/ letter < newletter

C.
sed ‘s/bob/Bob’ letter > newletter

D.
sed ‘s/bob/Bob/g’ letter > newletter

E.
sed s/bob, Bob/’ letter > newletter

Explanation:
A) missing replacement option "s", and would not replace all bob with Bob
B) would not write output to newletter (if it works at all)
C) not replacing all occurrences of bob
E) wrong syntax for replacement

2 Comments on “Which command would replace “bob” with “Bob” in all instances and generate a new lette

  1. jan says:

    There is a difference between a backtick : ` and a single quote: ‘
    according to bash. Be careful, this happens to more questions that were created with a wordprocessor that automagically produces “smartquotes”.




    0



    0

Leave a Reply