Replace all "\n" with "," using tr leaves a % at the end of the line, what is it?

Replace all "\n" with "," using tr leaves a % at the end of the line,

I have a file created in vi

name1 name2 name3 

When I run the following cat test.txt| tr "\n" "," I get name1,name2,name3,%

Could someone explain why it does appear

When I convert it to ascii codes i see

cat test.txt | tr "\n" "," | od -An -t uC

110 97 109 101 49 44 110 97 109 101 50 44 110 97 109 101 51 44

1

1 Answer

As @shawn mentioned this is just the shell showing there is no new line at the end of the output

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like