Question: Derive a sed command to delete all leading and trailing spaces in all lines in a file named foo. Of course, you need to create
Derive a sed command to delete all leading and trailing spaces in all lines in a file named foo. Of course, you need to create the file foo with relevant lines first and then use it to test your command.
Hint: use sed with two substitute instructions one finds and substitutes an empty string for the leading spaces and the other finds and substitutes an empty string for trailing spaces. Please show all steps.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
