Which of the following commands can be used to replace ‘professor’ with ‘director’ throughout the whole file?
(a) 1,$s/professor/director/g
(b) %s/professor/director/g
(c) 1,$s/professor/director
(d) 1,$s/professor/director/g and %s/professor/director/g
This question was posed to me during an online exam.
This is a very interesting question from Commands for Searching, Replacing and Substituting in Vi Editor topic in division The Vi Editor of Unix