Linked by Thom Holwerda on Wed 9th Aug 2017 21:50 UTC
General Unix

In what's never going to be a regular occurance, I'm linking to a Twitter thread. Chris Espinosa tweets:

Just as I was wrapping up an email and getting ready to leave work, a co-worker rolled his chair over to show me an "interesting" thing.

Go ahead, read it.

UNIX, man. Not even once.

Order by: Score:
Comment by Licaon_Kter
by Licaon_Kter on Wed 9th Aug 2017 22:34 UTC
Licaon_Kter
Member since:
2010-03-19

The zeitgeist is that the last 2 tweets are about Trump though...

Reply Score: 2

RE: Comment by Licaon_Kter
by Bill Shooter of Bul on Wed 9th Aug 2017 22:51 UTC in reply to "Comment by Licaon_Kter"
Bill Shooter of Bul Member since:
2006-07-14

Lo and behold! The Unix wizards at Bell labs foretold in ancient man files of the great baboon sent here to punish in the days when the sun would be eaten by the Night God Naztuli

Reply Score: 5

RE: Comment by Licaon_Kter
by Kochise on Fri 11th Aug 2017 12:39 UTC in reply to "Comment by Licaon_Kter"
Kochise Member since:
2006-03-03

Chris Espinosa? @cdespinosa Aug 8

Just as I was wrapping up an email and getting ready to leave work, a co-worker rolled his chair over to show me an “interesting” thing. He was in Terminal, looking for documentation on a new feature, and had been told that it only existed as a Unix ‘man’ page. He wanted to email it to somebody so he’d used the Terminal feature to capture output to a file, and had opened it in a text editor, but in the text file the title of the command and certain words in the text had ddoouubblleedd cchhaarraacctteerrss.

And forty years of my life dissolved away as into a mist, like I had nibbled on Proust’s madeleine. And I laughed and cried at the same time (Reply to this post if you know where this is going). Of course, I told him, Terminal is a tty, and man thinks that it’s a Decwriter from 1975. It is printing char-backspace-char to make it bold Terminal simulates the overstrike. But when it’s copied to a file it’s just 0x08 and nonprinting, and you see the doubled characters.

But I remembered, from 1997 when NeXT came in, or 1987 when I managed A/UX, or 1977 when I troffed the Apple II Reference Manual that the man page for man had the instructions for how to stop this. A flag? Redirecting standard out to a non-tty pipe? ‘man man’ it is… And though the man page has changed a lot in 40 years, it was still there. | col -b > filename.txt to strip the doubled characters. With also the magic words “reverse line feed.” Ah! Pinfeed perforated paper on a letter-quality printer!

See, there were these rollers with pins on them that fed the paper. But to tear off the last page the perf needed to be above the pin feed. That left 2” unused so if your top margin was less than that, it needed to inject a Form Feed, then six lines of Reverse Line Feed to print the top of the page but if you were piping to a text file the reverse line feeds would just overprint the last lines on the previous page. col filtered them out.

The memory of years of fussing with pinfeed paper and RIBBONS for God’s sake and top alignment and that in 2017 all that code is still there but the main point is that it being a living document we have no idea of what it originally said without the edit history.

Reply Score: 2

UNIX showing its age again...
by Morgan on Wed 9th Aug 2017 22:35 UTC
Morgan
Member since:
2005-06-29

That was a fun, if not entirely surprising read. Having worked as a teletype operator right out of high school (yes, the actual teletype machines with green screens and line printers), this was where I expected it to go.

God I love UNIX.

Reply Score: 1

RE: UNIX showing its age again...
by Doc Pain on Thu 10th Aug 2017 05:00 UTC in reply to "UNIX showing its age again..."
Doc Pain Member since:
2006-10-08

That was a fun, if not entirely surprising read.


Luckily, there are convenient ways to automatically transform manpages into pure ASCII text (no more highlighting, reverse, underlining) or to PDF, especially because PDF is a very popular document exchange format.

For illustration purposes:

% zcat /usr/share/man/man2/open.2.gz | groff -Tps -dpaper=a4 -P-pa4 -mandoc | ps2pdf - open.2.pdf

Of course, as we're talking about UNIX here, it's easy to create a "wrapper" around that mechanism so you can simply write something like

% man2pdf 2 open

and the script replies with

/tmp/open.2.pdf

which you can select and copy into your e-mail "attach file" dialog. Send the file, and the reader will benefit from a pleasantly formatted text document. Oh, and the recipient can print it, because people love printing stuff. ;-)

Adding a PDF (pre)viewer into the mix is trivial.

Of course if you only want to copy parts from a manpage, simply select the text with the left mouse button inside the terminal, switch over to your mail composing window, press the middle mouse button (or wheel, or left+right button, depending on your mouse's capabilities) to simply paste the text.

No "double-printed" characters.

(NB: "the terminal", generic term, not "Terminal", because due to technology advancement, this might not work anymore.)

Having worked as a teletype operator right out of high school (yes, the actual teletype machines with green screens and line printers), this was where I expected it to go.


When I read "actual teletype", I imagine a real teletype like the T-51, the F1200 or F2000 built by RFT. Non-german persons probably know the famous Model 33 / ASR-33 as one of the first means to interact with UNIX computers. No fancy screen, and very limited output speed.

Rattattattattattattatt - ding!

God I love UNIX.


You have to, because it runs the Internet. :-)

Reply Score: 8

Morgan Member since:
2005-06-29

When I read "actual teletype", I imagine a real teletype like the T-51, the F1200 or F2000 built by RFT. Non-german persons probably know the famous Model 33 / ASR-33 as one of the first means to interact with UNIX computers. No fancy screen, and very limited output speed.


Yeah, I'm old but I'm not that old. I'll get off your lawn now. ;-)

Reply Score: 3

RE[2]: UNIX showing its age again...
by grat on Thu 10th Aug 2017 19:53 UTC in reply to "RE: UNIX showing its age again..."
grat Member since:
2006-02-02

Luckily, there are convenient ways to automatically transform manpages into pure ASCII text (no more highlighting, reverse, underlining) or to PDF, especially because PDF is a very popular document exchange format.


I wouldn't consider most of your examples to be "convenient". I recall piping the output of man to nroff, but that's a really old memory.

Personally, I find that

man ls > ls.txt

is all I need to do under my current bash environment.

Reply Score: 2

Doc Pain Member since:
2006-10-08

I wouldn't consider most of your examples to be "convenient". I recall piping the output of man to nroff, but that's a really old memory.

Personally, I find that

man ls > ls.txt

is all I need to do under my current bash environment.


When I do this in my (home) UNIX environment (not Linux, not bash), I get a text file with control characters (the ^H as backspace for "overprinting" as well as the double characters and the _ underlining). Example line:

-^H-D^HD _^Hf_^Ho_^Hr_^Hm_^Ha_^Ht

This is the text found in the text file for

-D format

Reading the file with "less ls.txt" again restores the look of the manpage including highlighted and underlined characters, in this example, "-D" printed bold, and "format" underlined. Outputting it with "cat ls.txt" directly to the terminal does not display the control characters - normal text is written to the terminal. But they are still there - "cat ls.txt | less" leads to the "manpage style" again.

It might be possible that in your environment the control characters are stripped automatically. Maybe your man's roff implementation (nroff, groff, troff, etc) behaves different, maybe the shell changes $PAGER for the process to something else than the traditional "less" upon redirection...

Reply Score: 2

Soulbender Member since:
2005-08-18

man ls > ls.txt


Gives a correctly formatted text file on Ubuntu 17.04.

Reply Score: 2

grat Member since:
2006-02-02

It might be possible that in your environment the control characters are stripped automatically. Maybe your man's roff implementation (nroff, groff, troff, etc) behaves different, maybe the shell changes $PAGER for the process to something else than the traditional "less" upon redirection...


I actually expected the behavior you saw-- even did hexdump -C to verify there are no hidden control characters.

Interestingly, under FreeBSD, I get the behavior described above-- control characters and double-characters for bold text.

Reply Score: 2

Nth_Man Member since:
2010-05-16

Yes, the article is really misleading...

A simple
     man to pdf
search in Google showed a simple way to get a pdf file from `man bash`:
     man -t bash | ps2pdf - bash.pdf

Edited 2017-08-14 08:16 UTC

Reply Score: 2

Comment by Drumhellar
by Drumhellar on Wed 9th Aug 2017 23:15 UTC
Drumhellar
Member since:
2005-07-12

What OS is was he using? I'm guessing macOS, since he's referring to "Terminal", rather than "the terminal", or xterm, gnome-terminal, etc etc.

And if that's the case, well, which new features of macOS has documentation that exists only as a man page?

That's the real question.

Reply Score: 3

RE: Comment by Drumhellar
by judgen on Thu 10th Aug 2017 01:24 UTC in reply to "Comment by Drumhellar"
judgen Member since:
2006-07-12

Or maybe IRIX, BeOS, Haiku, Syllable, AtheOS or perhaps SkyOS. :-P

Edited 2017-08-10 01:25 UTC

Reply Score: 2

RE[2]: Comment by Drumhellar
by Drumhellar on Thu 10th Aug 2017 05:07 UTC in reply to "RE: Comment by Drumhellar"
Drumhellar Member since:
2005-07-12

And none of those have any new features.

Except maybe Haiku.

Reply Score: 2

RE[2]: Comment by Drumhellar
by Andre on Fri 11th Aug 2017 23:36 UTC in reply to "RE: Comment by Drumhellar"
Andre Member since:
2005-07-06

SkyOS.... I almost forgot about it...

Reply Score: 1

RE: Comment by Drumhellar
by rjamorim on Thu 10th Aug 2017 01:37 UTC in reply to "Comment by Drumhellar"
rjamorim Member since:
2005-12-05

I'm guessing macOS, since he's referring to "Terminal"


I'm guessing macOS because we're talking about Chris Espinosa:
https://en.wikipedia.org/wiki/Chris_Espinosa

Reply Score: 4

RE: Comment by Drumhellar
by Carewolf on Fri 11th Aug 2017 11:29 UTC in reply to "Comment by Drumhellar"
Carewolf Member since:
2005-09-08

Which also explains why his shell is so bad it didn't handle the conversion in the streaming operator like a modern Linux shell.

Reply Score: 2

Capabilities
by uridium on Thu 10th Aug 2017 00:56 UTC
uridium
Member since:
2009-08-20

Check your termcap if it has LA36 or LA180 definitions, it'll be an interesting read.

Also the caps makes it easier to parse with DEC runoff which is nice for those of us with VT terminals still attached to our VAX and pdp-11's.

Reply Score: 2

RE: Capabilities
by acobar on Thu 10th Aug 2017 02:49 UTC in reply to "Capabilities"
acobar Member since:
2005-11-15

You must be kidding you still have a working PDP-11, right? It was one of the first computers I had access on my uni, like ~33 years ago!

On a side note, I'm not surprise at all things like "double characters" and many other ancient capabilities are still around. On Unix world it used to be "if it is not broken ..".

Many of us that connect remotely to fix/check things still prefer to use "character" terminals for fast and practical reasons and in this world esc, \b, \r and other special chars and sequences are still king, and fun to play with. ;)

Reply Score: 3

RE[2]: Capabilities
by uridium on Fri 11th Aug 2017 12:59 UTC in reply to "RE: Capabilities"
uridium Member since:
2009-08-20

Yep. It's like classic cars, plenty of us aa^Hdd^Hdd^Hii^Hcc^Htt^Hss^H enthusiasts out there that still run them. Granted you can emulate faster than real hardware, but part of the charm is restoring, running and operating these old girls. I have a few. Once you've moved in the circles, pdp-11 owners come out of the woodwork. Plenty around ;)

There's even modern extensions now days such as Bilquist's BQTCP, Telnet, FTP, and web server (BQHTTP) for them. The old girls continue to run and be enjoyed. If you just want to emulate one, try simh as a starting point and see if you catch the bug. If you do, a cheap DECServer550 with the resistor and ROM hack is a cheap and easy entry-point.

Reply Score: 2

To print a man page I usually do...
by mattias1 on Thu 10th Aug 2017 06:10 UTC
mattias1
Member since:
2014-12-15

I usually use something like:

man -t man | lp

Tell this your coworkers...

Reply Score: 1

nicubunu Member since:
2014-01-08

they wanted to email the output, in such case i would use

man man > file.txt

Reply Score: 3

Doc Pain Member since:
2006-10-08

they wanted to email the output [...]


That is quite simple, just use the power of UNIX:

% man rm | mail -s "How to add a remark to files" bob@example.com

;-)

Reply Score: 2

20 tweets to discuss man overprinting?
by rklrkl on Thu 10th Aug 2017 13:14 UTC
rklrkl
Member since:
2005-07-06

Nobody commenting on why he's using Twitter to discuss man overprinting? With the char limit, it ended up as 20 tweets in all - wrong social media platform methinks :-)

Reply Score: 6

Alfman Member since:
2011-01-28

rklrkl,

Nobody commenting on why he's using Twitter to discuss man overprinting? With the char limit, it ended up as 20 tweets in all - wrong social media platform methinks :-)



Yep, your absolutely right. It's the "in" social media platform, but for technical merit it leaves a lot to be desired. I lean towards more in depth discussion with good amounts of context, whereas twitter effectively undermines all of that.

On the other hand, I do think it's the ideal platform for anyone with an aversion to detail, like presidents who like to talk alot yet actually have very little to say.

Reply Score: 3

flashback
by chrish on Thu 10th Aug 2017 13:34 UTC
chrish
Member since:
2005-07-14

Back in the day I helped convert a huge documentation set from roff format (so, man pages) to Word for DOS via some parser that converted the roff to RTF.

man's ecosystem has always been awful, which is why there have been so many attempts to replace it (POD, for example).

Reply Score: 2

Comment by tidux
by tidux on Thu 10th Aug 2017 15:53 UTC
tidux
Member since:
2011-08-13

$ man "not even once"
No manual entry for not even once
$

Reply Score: 2

Person is not an idiot, just ignorant
by cjcox on Thu 10th Aug 2017 23:24 UTC
cjcox
Member since:
2006-12-21

As other have said, the terminal being used isn't handling the overstrikes. With that said, in their raw form, the roff man pages can be formatted for output proper to your end device. Shoot, you can even have it output HTML (with a few hiccups... depending on what your man supports).

Dare I even say, man col (if this an old Unix host especially)

Reply Score: 1

Twitter? Not even once...
by number9 on Thu 10th Aug 2017 23:45 UTC
number9
Member since:
2005-10-25

This is the first time in many, many years that I have gone to Twitter to read anything.

Ok, so perhaps I am an old fart, but WTF?!?

Does everyone read crap like this?

I mean, the story is not crap. Maybe. Dunno.

But having to read it in extremely small chunks.

It is.

Kind of.

Annoying.

Really.

Damn.

I couldn't make it.

Edited 2017-08-10 23:46 UTC

Reply Score: 3

RE: Twitter? Not even once...
by Alfman on Fri 11th Aug 2017 05:47 UTC in reply to "Twitter? Not even once..."
Alfman Member since:
2011-01-28

number9,

This is the first time in many, many years that I have gone to Twitter to read anything.
Ok, so perhaps I am an old fart, but WTF?!?
...
It is.
Kind of.
Annoying.
Really.
Damn.
I couldn't make it.


twitter is the geocities of millennials.

Reply Score: 3

RE[2]: Twitter? Not even once...
by The123king on Fri 11th Aug 2017 08:30 UTC in reply to "RE: Twitter? Not even once..."
The123king Member since:
2009-05-28

I think Geocities would be offended at the comparison

Reply Score: 2

Megol@somewhere.org
by Megol on Fri 11th Aug 2017 09:00 UTC
Megol
Member since:
2011-04-11

Not being a twit

Reply Score: 2

Megol@somewhere.org
by Megol on Fri 11th Aug 2017 09:00 UTC in reply to "Megol@somewhere.org"
Megol Member since:
2011-04-11

reading that

Reply Score: 2

Megol@somewhere.org
by Megol on Fri 11th Aug 2017 09:01 UTC in reply to "Megol@somewhere.org"
Megol Member since:
2011-04-11

is a bloody pain!

Reply Score: 2