1.

To replace | with ~, which one of the following commands will be used?(a) tr ‘|\’‘~-‘(b) tr ‘|\’‘~-‘ > emp.lst(c) tr |~ emp.lst(d) !I got this question in an interview for job.My question comes from Unique and tr Command in division Simple Filters of Unix

Answer»

The correct answer is (b) tr ‘|\’‘~-‘ > emp.lst

For explanation I would SAY: The translate (tr) FILTER is used for manipulating individual characters in a LINE. It replaces the first character in the first EXPRESSION with the first character in the second expression.



Discussion

No Comment Found

Related InterviewSolutions