x404.co.uk
http://www.x404.co.uk/forum/

Who said the command line wasn't fun?
http://www.x404.co.uk/forum/viewtopic.php?f=4&t=1258
Page 1 of 1

Author:  forquare1 [ Mon Jun 15, 2009 4:10 pm ]
Post subject:  Who said the command line wasn't fun?

*****************************************************************************************************************************
NOTE: The following does not use any harmful commands, if in doubt, use the `man` command to view what a command does like this:
man echo
*****************************************************************************************************************************

Who said using the command line was boring, difficult and has no place in computing today? It comes in very handy when you're bored!

Using your favorite plain text editor (Kate, gEdit, Vi(m), Emacs), copy and paste the following into it:
Code:
#!/bin/bash
# Hacked together by Ben Lavery
# 15th June 2009
# b   l   r   m   .       \   X   /
#  e . a e y g a l c m     \ / \ /
#   n   v   @   i   o       V   V

LINE=`resize | grep -i line | grep -iv colu |sed 's/[a-zA-Z]//g' | sed 's/\(=\)\(.*\)\(;\)/\2/'`

clear(){
   for i in $($LINE)
        do
                echo
        done
}

wave(){
   echo "    o/" && echo "   .|" && echo "   / \\"
   sleep 1
   clear   

   echo "    o|" && echo "   .|" && echo "   / \\"
   sleep 1
   clear
}


clear

while :
do
   #echo "    o/" && echo "   .|" && echo "   / \\"
   #sleep 1
   #clear   

   wave
   wave
   wave

   echo "    o" && echo "   .|\\" && echo "   / \\"
   sleep 1
   clear
   
   echo "     o" && echo "     |" && echo "     |"
   sleep 1
   clear
   
   echo "      o" && echo "     /|." && echo "     / \\"
   sleep 1
   clear
   
   echo "       o"  && echo "       |" && echo "       |"
   sleep 1
   clear
   
   echo "        o" && echo "       .|\\" && echo "       / \\"
   sleep 1
   clear
   
   echo "        o" && echo "       .|\\" && echo "       / \\"
   sleep 1
   clear
   
   echo "        o" && echo "       /|." && echo "       / \\"
   sleep 1
   clear
   
   echo "       o" && echo "       |" && echo "       |"
   sleep 1
   clear
   
   echo "      o" && echo "     /|." && echo "     / \\"
   sleep 1
   clear
   
   echo "     o" && echo "     |" && echo "     |"
   sleep 1
   clear
   
   echo "    o"  && echo "   .|\\" && echo "   / \\"
   sleep 1
   clear
   
done


Save it as ta-da.sh on your desktop

Open up Terminal/Term/xterm/etc and perform the following operation on it:
cd $HOME/Desktop
chmod 555 ta-da.sh
./ta-da.sh

Use ctrl+c to exit the script.

Enjoy :P 8-)

Author:  EddArmitage [ Mon Jun 15, 2009 7:31 pm ]
Post subject:  Re: Who said the command line wasn't fun?

You want to use jot instead of seq on OS X, or write your own version of seq. And possibly explain that Ctrl+c should be use to exit it, for those not aware of how to use bash.

Edd

Author:  forquare1 [ Mon Jun 15, 2009 7:56 pm ]
Post subject:  Re: Who said the command line wasn't fun?

EddArmitage wrote:
You want to use jot instead of seq on OS X, or write your own version of seq. And possibly explain that Ctrl+c should be use to exit it, for those not aware of how to use bash.

Edd


Ah, good point, sorry, I hadn't tested it on other systems, was just a bit or geeky fun during lunch...
I must admit I thought most people would close the window...

Author:  EddArmitage [ Mon Jun 15, 2009 7:57 pm ]
Post subject:  Re: Who said the command line wasn't fun?

forquare1 wrote:
I must admit I thought most people would close the window...

Oh yes. I'm just used to always having a Terminal.app window open somewhere at all times!

Edd

Author:  forquare1 [ Mon Jun 15, 2009 8:10 pm ]
Post subject:  Re: Who said the command line wasn't fun?

EddArmitage wrote:
forquare1 wrote:
I must admit I thought most people would close the window...

Oh yes. I'm just used to always having a Terminal.app window open somewhere at all times!

Edd


Amendments made, if anyone is having problems with the `resize` command, please use a different application, it's part of the X11 spec, or something...
And added the note about ctrl+c :)

Edd, Terminal is usually open at home, and I frequently hit the limit at work, most are unused, but I don;t clear up after myself, and 8 workspaces * 3 monitors...I can get quite a few!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/