Hidden special character

Hi,

Anyone can help with my problem, I have an issue with hiddend special character each line of my file.

When I open the file using vim

#test.txt

aaa
bbb
ccc

Inside the vim I command :set list , and then the list would become

#test.txt

aaa$
bbb$
ccc$

How to remove the hidden white spaces "$" using sed command.

Thank you in advance.

Regards,
FSPalero

There are no hidden white spaces. When using list mode in vim , the $ at the end of the line in the output indicates the position of the <newline> character terminating the line. In list mode, spaces appear as spaces, tabs appears on the screen as the two character sequence ^I and a <carriage-return> character would appear on the screen as the two character sequence ^M .

set list highlights white space characters - one of which is \n the newline character.

There are no hidden spaces based on your display.
To verify try:

od -d test.txt

This command displays EVERY character in a file.

-- oops Don types faster than I do.

An alternative to using od is cat -vET or cat -A . This will show all non-printing characters, tab characters and line-ends; I think the set list command in vi just shows the line ends and tab characters.

Andrew

Hi Andrew,
No, the standards say that the list command in vi and ex causes <newline> characters to be displayed as a <dollar-sign> at the end of the line they terminate, the <backslash> character as two <backslash> characters, and other non-printable or control characters to be displayed as backslash escape sequences.

I have seen some versions of ex , vi , and vim that print control characters (other than <newline>) as the two character sequence ^x where x is the key on the keyboard that would be pressed while the control key is being held down that would produce that character (instead of printing the backslash escape sequences required by the standards), but I haven't seen any version of ex , vi , or vim that fails to print non-printable characters as identifiable character sequences when printing in list mode.