You are not logged in.

#1 2009-10-10 07:51:43

unregistered
Member
Registered: 2008-04-09
Posts: 134

Question about the less command *

when I less a text file, sometimes I get a <FF> symbol at the end, what does it mean?

Last edited by B (2009-10-10 09:01:24)

Offline

#2 2009-10-10 14:08:21

scragar
Member
Registered: 2009-07-14
Posts: 108

Re: Question about the less command *

It's the representation of some binary characters, it's the hex code for the character that it found and couldn't do anything else with.

Offline

#3 2009-10-12 00:00:48

unregistered
Member
Registered: 2008-04-09
Posts: 134

Re: Question about the less command *

scragar wrote:

It's the representation of some binary characters, it's the hex code for the character that it found and couldn't do anything else with.

I found out that the character is end of file.
from the hex code, how can I derive which character is it? Does it conform to the ascii standard?

Offline

#4 2009-10-12 00:51:36

scragar
Member
Registered: 2009-07-14
Posts: 108

Re: Question about the less command *

I don't think it is anything, FF is the highest number you can represent in hex, 255 out of 255, I don't think any character encoding has that many characters.

EDIT: most ascii tables only go as high as 127, more have been added, but I do believe it only brings the numbers up to around 190 or so, not to a full 255.

Last edited by scragar (2009-10-12 00:52:44)

Offline

#5 2009-10-12 03:55:49

majiq
Member
Registered: 2009-03-06
Posts: 259

Re: Question about the less command *

From my experience, those are usually unicode characters. Check the encoding of the file.

Offline

#6 2009-10-12 05:23:55

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: Question about the less command *

You might be seeing a form-feed character, "FF".  It tells the tractor printer to go to the next page.  It's '014' in octal, '12' in decimal, '0C' in hex.

The command, "xxd somefile", will do a hexdump of 'somefile'.  Ascii codes can be seen using "man ascii".

"enca -L none somefile" or "file somefile" should tell you if it's an ascii file (7-bit encoding).

Last edited by thisoldman (2009-10-12 05:34:40)

Offline

Board footer

Powered by FluxBB