I am using the following code to remove both leading and tailing spaces from all lines of a file A.txt
sed s/^[ ]*//;s/[ ]*$// ./A.txt > ./B.txt
The problem occurs on the lines where there is a t in the beginning or at the end. So say for example, the original line that starts with the string "timezone" becomes "imezone"
Can you please tell me what is happening here? and also if there is a known solution to the problem.
Thanks in advance.