Get Examples for Random Bash Commands
Following my post about a script to query bash commands from shell-fu, here is another script, which queries shell-fu for examples of a random bash command:
The script is not bullet-proof and might fail if the guys at shell-fu decide to change the website’s layout, but it works for now, and this is good
Open a new text file and type this:
1
2
3
4 #!/bin/bash
PAGER="/usr/bin/less -rXF"
lynx -width=$COLUMS -nonumbers -dump "http://www.shell-fu.org/lister.php?random" |\
sed -n '/Tailrank/,/View Comments/p' shrnd.tmp | sed '$d' | sed '1,2d' | $PAGER
Now save the file as shexrand, or any other name (shexrand is for shell example – random)
Make the file executable:
chmod +x shexrand
Now move the file to /usr/local/bin
Thats it, to use it, just type:
shexrand
and you should get an example of a random bash command.
Enjoy
If you enjoyed this post, make sure you subscribe to my RSS feed!Related posts:
Leave a Reply
About Me
Tags
Categories
- Algorithms
- Bash
- BlackBerry
- Collaboration
- Command Line
- Cool Tricks
- Easter Eggs
- Ebooks
- Firefox
- Hardware
- Humor
- iPhone
- Linux
- Linux Development
- Linux Kernel
- Networks
- Open Knowledge
- Other
- Productivity
- Programming
- Regular Expressions
- Science
- Security
- Shell Scripts
- Short Posts
- Social Networks
- Thoughts
- Tools
- Vim
- Web Development
- Websites
Popular Posts
Archives
- July 2010 (5)
- June 2010 (1)
- May 2010 (1)
- April 2010 (3)
- March 2010 (1)
- January 2010 (1)
- December 2009 (2)
- September 2009 (13)
- July 2009 (1)
- June 2009 (6)
- May 2009 (4)
- March 2009 (18)
- February 2009 (10)
- January 2009 (10)
- December 2008 (7)
- November 2008 (8)
- October 2008 (1)
- August 2008 (1)
- July 2008 (1)
- June 2008 (2)
