• Home
  • About Me
  • Contact

kanorben.net - blog

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

 

April 2008
M T W T F S S
« Mar   May »
 123456
78910111213
14151617181920
21222324252627
282930  

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

    • ledger
    • Git User's Manual (for version 1.5.3 or newer)
    • Don’t overuse classes in Python | The GITS Blog
    • BBC NEWS | UK | Magazine | The rival to the Bible
    • Elite Officer Recalls Bin Laden Hunt, Delta Force Commander Says The Best Plan To Kill The Al Qaeda Leader In 2001 Was Nixed - CBS News
    • How Laser TVs work at BrainStuff
    • uMac | University of Utah | Xhooks

    RSS My Facebook Posted Items

    • Elite Officer Recalls Bin Laden Hunt, Delta Force Commander Says The Best Plan To Kill The Al Qaeda
    • 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

    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 |

    Leave a Comment

    Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

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