I cannot find any binary editor in v7 unix by reading volumn 1 of the manual.
Is there any?
Best Answer
There's no hex editor built in, the closest you're going to have is combining od and the ed editor, both of which are available in Version 7. vi isn't included with Version 7, you could probably compile an old version since it was released about that time.
The man page of od should be useful. The man page of ed, not as much, but if you know sed, ed commands are a lot like sed since sed is based on ed. You can try reading tutorials here and here or just google "ed editor" "ed tutorial" and so on.
You could try building your preferred editor but I don't know how that will work out on an OS that is over 30 years old.
As a general purpose editor, probably not, but as a way to get yourself out of a pinch, it's good to know a few basics. The good news is that if you know your way around vim, it's likely you can use that knowledge to blunder around in ed. The times are changing, but there are still systems that it might be your best editor or connection scenarios that call for it. I've used it from my super-slick smartphone logged into a modern linux box when the connection was bad enough that running a full editor was taking forever and I really needed to just change a line and get out.
It appears to be the presence of the null character in the file.(displayed ^@ usually)
I entered various control characters into a text file(like delete, ^?, for example), and only the null character caused grep to consider it a binary. This was only tested for grep. The less and diff commands, for instance, may have different methods.
Control characters in general don't appear except in binaries. The exceptions are the whitespace characters: newline(^M), tab(^I), formfeed(^L), vertical tab(^K), and return(^J).
However, foreign characters, like arabic or chinese letters, are not standard ascii, and perhaps could be confused with control characters. Perhaps that's why it's only the null character.
You can test it out for yourself by insterting control characters into a text file using the text editor vim. Just go to insert mode, press control-v, and then the control character.
Best Answer
There's no hex editor built in, the closest you're going to have is combining
od
and theed
editor, both of which are available in Version 7.vi
isn't included with Version 7, you could probably compile an old version since it was released about that time.The man page of
od
should be useful. The man page ofed
, not as much, but if you know sed, ed commands are a lot like sed since sed is based on ed. You can try reading tutorials here and here or just google "ed editor" "ed tutorial" and so on.You could try building your preferred editor but I don't know how that will work out on an OS that is over 30 years old.