TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Fortune(6) – Linux Man Page

41 点作者 lukasgelbmann3 个月前

8 条评论

js23 个月前
A tale about Perl array vs scalar context and `fortune` has gone missing from the internet (edit: found it, see below). I&#x27;ll do my best to recount it.<p>The story goes a kid in high school setup a web page that displayed fortunes from, well, fortune. He did this via a Perl CGI program. One day, fortune spit out the following quote just as a teacher was viewing the page:<p><i>I put the shotgun in an Adidas bag and padded it out with four pairs of tennis socks, not my style at all, but that was what I was aiming for: If they think you&#x27;re crude, go technical; if they think you&#x27;re technical, go crude. I&#x27;m a very technical boy. So I decided to get as crude as possible. These days, thought, you have to be pretty technical before you can even aspire to crudeness. I&#x27;d had to turn both those twelve-gauge shells from brass stock, on the lathe, and then load then myself; I&#x27;d had to dig up an old microfiche with instructions for hand-loading cartridges; I&#x27;d had to build a lever-action press to seat the primers -all very tricky. But I knew they&#x27;d work.</i> -- Johnny Mnemonic<p>Unfortunately due to the kid mistaking scalar vs array context, only the first line of the paragraph was displayed: <i>I put the shotgun in an Adidas bag and padded it out with four pairs of tennis socks</i>.<p>Missing the attribution, the teacher did not recognize this as a book quote. This resulted in police being called on the kid. Fortunately it was resolved w&#x2F;o incident.<p>Now, I may be misremembering the story which isn&#x27;t mine. I vaguely recall that maybe it was something Tom Christiansen used to tell? Maybe it appeared on Slashdot? Maybe it&#x27;s apocryphal? I can&#x27;t find the original.<p>Edit: Randal Schwartz recounted the story here:<p><a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20070126150617&#x2F;http:&#x2F;&#x2F;www.stonehenge.com&#x2F;merlyn&#x2F;UnixReview&#x2F;col38.html" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20070126150617&#x2F;http:&#x2F;&#x2F;www.stoneh...</a><p>It was originally on Slashdot and I mostly got the details right. :-)
globnomulous3 个月前
<i>Bugs</i><p><i>The supplied fortune databases have been attacked, in order to correct orthographical and grammatical errors, and particularly to reduce redundancy and repetition and redundancy. But especially to avoid repetitiousness. This has not been a complete success. In the process, some fortunes may also have been lost.</i><p>Finding humor in a man page warms the heck out of my heart.
zengargoyle3 个月前
Sit right back and I&#x27;ll tell you a tale. Fortune is a parasite glommed over the original intents of the Architecture of what is now known as Fortune.<p>Originally as the high gods intended the whole mess was nothing but a Rolodex, a box of index cards, etc.<p>You see, the first line of the &#x27;%&#x27; delimited records would be a &#x27;LAST FIRST PHONE&#x27; and the rest would be for instance &#x27;SMITH, JOE 867-5309&#x27; on the rest would be &#x27;wife Mary, 3 kids (Joseph, Adam, Beth), maybe address, etc.&#x27;.<p>The &#x27;.dat&#x27; portion created by the &#x27;strfile&#x27; would take that file and alphabetize it and then keep the &#x27;seek&#x27; offsets in the file for each record. This let you have a big (for the time) Rolodex with fast retrieval upon search. Binary tree and all that, plus fast read of whole record because ... binary search, read one line match or not then difference between match and next record would be bytes needed to read (minus 1 for the &#x27;%&#x27;.<p>Fortune &#x27;fortune(6)&#x27; started life as an address book,The random and multiple files and all that jazz was just a bunch of repurposing that took over and became a life of it&#x27;s own. Nobody uses the &#x27;first line sort&#x27; bit of &#x27;strfile&#x27; program. Mostly the original has vanished into the wind, I have no clue what the command line thing was to bring up the Rolodex&#x2F;Index Card of somebody was.<p>The &#x27;man&#x27; page doesn&#x27;t do it justice, but nobody really cares, and I like many others have a &#x27;~&#x2F;quotes&#x27; file that is automated and hot-key bound to selecting a bit of text and preassing a couple of keys. If you know the <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Reservoir_sampling" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Reservoir_sampling</a> thing, you dont&#x27; even need the &#x27;.dat&#x27; file for the random bit.
评论 #43195745 未加载
mmsc3 个月前
Small programs like Fortune and Cowsay are a treasure to the culture of Unix-like OS&#x27;.
评论 #43191723 未加载
lionkor3 个月前
On arch, fortune builds with the -o (offensive) flag disabled. Talk about censorship!
tbrownaw3 个月前
I used to have a fortune file where I kept various quotes from Internet communities.
评论 #43191713 未加载
brainlessdev3 个月前
A while ago I made a fortune database that draws from Marcus Aurelius&#x27;s Meditations. I used to have a tmux pane that ran them on my work session boot script :)
throwaway9843933 个月前
It&#x27;s sad that some distros refuse to package with -o option support anymore
评论 #43191743 未加载
评论 #43191701 未加载