LPI
101-500 · Question #23
Which of the following commands replaces each occurrence of 'bob' in the file letter with 'Bob' and writes the result to the file newletter?
The correct answer is D. sed 's/bob/Bob/g' letter > newletter. You've hit your Sonnet limit · resets Jun 8, 9am (UTC)
GNU and Unix Commands
Question
Which of the following commands replaces each occurrence of 'bob' in the file letter with 'Bob' and writes the result to the file newletter?
Options
- Ased '/bob/Bob' letter > newletter
- Bsed s/bob/Bob/ letter < newletter
- Csed 's/bob/Bob' letter > newletter
- Dsed 's/bob/Bob/g' letter > newletter
- Esed 's/bob, Bob/' letter > newletter
How the community answered
(40 responses)- B8% (3)
- C5% (2)
- D85% (34)
- E3% (1)
Explanation
You've hit your Sonnet limit · resets Jun 8, 9am (UTC)
Topics
#sed substitution#global flag#I/O redirection#regex patterns
Community Discussion
No community discussion yet for this question.