Lurker News

Comments (96) 22 threads

Show all comments

Showing thread 1 of 22

TheAceOfHearts6 replies#
A bit tangential, here's a few unix utils you can use to inspect text:

`vis`: display non-printable characters in a visual format
`cat -e`: Display non-printing characters and display a dollar sign (`$') at the end of each line.
`hexdump -c`: Display the input offset in hexadecimal, followed by sixteen space-separated, three column, space-filled, characters of input data per line.
`od -a`: Output named characters.

pavelbr3 replies#
Is `hexdump` not `xxd`?
lainga#
`hexdump` is part of util-linux, `xxd` is not. They do the same thing though, up to formatting differences.
dotancohen#
And on Debian it's called `hd`.
gkya1 reply#
xxd is part of vim IIRC.
cyphar1 reply#
> `vis`: display non-printable characters in a visual format

Or `cat -v`, the namesake of http://cat-v.org/. :P

logicallee2 replies#
what is cat-v.org? (Obviously I visited that link, read the about page - I'm asking for your summary. it's still not clear to me after my initial visit.)
scbrg1 reply#
I'm sure there are better people to answer this question, but cat-v.org is the personal blog & collection of interesting stuff by former plan9 personality uriel (sadly no longer with us). It hosts random thoughts and lots of interesting stuff (including man pages) about plan9 and early unix systems, and miscellaneous other unix trivia.

It really is a treasure. Take the time to browse, it's well worth it if you're somewhat interested in unix history and not overly familiar with the subject already.

Continue this thread — 1 reply

gkya4 replies#
Nostalgic Unix nerds hating on everything that (i) was not in original Unix, or (ii) in Plan9, or (iii) not implemented by authors of these.

Continue this thread — 4 replies

agumonkey#
and under emacs whitespace-mode (just in case)
LVB2 replies#
Further tangent: a colleague and I talked about creating a derivative of one of the programmer fonts, replacing smart/curly quotes and another such nuisances with unmistakeable indicators.
sharpercoder#
This would be a useful feature for any programming font. I can totally imagine writing exploits through zero-width characters; smart insertion into interpreted strings (scanners/parsers) can potentially insert a security leak by an attacker. Though input can come from many places off course, this would at least make one vector visible.
peteretep#
You could probably just invert any non-ASCII character, and you could probably do this programmatically over an existing font.
wpietri#
Ooh! I adore `od`, and know too many options for it. But I didn't know about the others. Thanks!

I'll also add my favorite companion to `od` and hexdumps: `man ascii`.
P.S. May we please have a basic Markdown parser for HN?

Flimm#
Do you have any useful commands like these that can handle multi-byte characters in UTF-8? For instance, handling the zero-width space U+200B, which in UTF-8 takes up more than one byte. I've got some custom scripts that do, I was wondering if there was already something out there.