• Home
  • About Me
  • Contact

kanorben.net - blog

My personal blog on technology, programming, life, and the random

 

September 2008
M T W T F S S
« Aug    
1234567
891011121314
15161718192021
22232425262728
2930  

Blogroll

  • Boing Boing
  • BorjaNet
  • Brian Mayer
  • Dean Armstrong’s Blog
  • Ellen Smith’s blog
  • Faraocious
  • Gross or Awesome?
  • Marcus Westin’s Blog
  • Nightmares of David Bowie’s Package
  • Paul Mantz’s Blog
  • Slashdot
  • Tomorrow with Alex Beinstein
  • Valleywag

Personal Sites

  • DOIT Fortune Database
  • My bookmark’s on del.icio.us
  • My CS account page
  • My Facebook Profile
  • My LinkedIn Page
  • My Picasa Albums
  • My Twitter
  • pyXSD
  • The SUCCESS Blog
  • UofC ACM Site

webcomics

  • Questionable Content
  • Saturday Morning Breakfast Cereal
  • The Perry Bible Fellowship
  • Welcome To The Future
  • xkcd

Meta

  • Register
  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
Add to Google Add to My Yahoo! Subscribe with Bloglines
Bloggers' Rights at EFF

Twitter Updates

    RSS My Del.icio.us

    • Your Privacy Is An Illusion: Google Street View steers clear of Obama's neighborhood
    • Index of ftp://ftp.apcc.com/apc/public/software/macintosh/osx/pcns/201/
    • Hulu - The Olympia Restaurant: Saturday Night Live
    • RACHEL PAPO : Serial No. 3817131
    • Breakdowns: Netflix crash caused by botched Oracle upgrade
    • pygraphviz - NetworkX
    • Pentagon's Unmanned Spokesdrone Completes First Press Conference Mission | The Onion - America's Finest News Source

    RSS My Facebook Posted Items

    • Language Fail
    • Safety Fail
    • Gnarls Barkley Crazy Theremin Jam
    • Domino's Scientists Test Limits Of What Humans Will Eat | The Onion - America's Finest News Source
    • 'Warcraft' Sequel Lets Gamers Play A Character Playing 'Warcraft' | The Onion - America's Finest New

    Shell Palindrome Fun

    April 10th, 2008 by knorby

    I had some good old fashion fun today on the shell today. I stumbled across this “gem” of an expression:

    yes xargs | xargs yes

    This expression can be repeated infinitely (mostly) many times without changing the output and without loosing symmetry when joining on the yes’s. In other words, the last expression is equivalent (in regards to output and symmetry):

    yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes xargs | xargs yes

    You can throw some rot13s (with care), cats, and a few other commands in there with the same effect. I am not sure exactly how it functions; it seems to work different on different OSes. I have tried in on Linux, Mac OS X, Solaris, and OpenBSD, and all seem to be a bit different. They seem to run a bit differently, and the output is different. It’s all very fun.

    Update: I thought I should clarify that last little bit. The way pipes are treated seems to vary some; the actual functionality is trivial.

    Posted in Apple, Linux, OpenBSD, Solaris, humor, shell scripting | No Comments

     
    Add to Technorati Favorites - Creative Commons License - © 2007 Karl Norby