Skip to content

Instantly share code, notes, and snippets.

@alseambusher
Created February 27, 2013 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alseambusher/5044532 to your computer and use it in GitHub Desktop.
Save alseambusher/5044532 to your computer and use it in GitHub Desktop.
Make STAR WARS come when you open the terminal
function print_element {
while [ $cols -ge 1 ]
do
printf "$element"
cols=`expr $cols - 1`
done
}
function print_sentence {
cols=`tput cols`
size=`expr "$sentence" : '.*'`
cols=`echo "($cols-$size)/2"|bc`
cols=`expr $cols - 1`
element=' '
print_element
echo $sentence
}
cols=`tput cols`
element='~'
print_element
#PRINTING STAR WARS
if [ `tput cols` -le 80 ]
then
if [ $# -ne 1 ]
then
cols=`tput cols`
cols=`echo $cols/2-17|bc`
element=' '
print_element
echo " 8888888888 888 88888 "
cols=`tput cols`
cols=`echo $cols/2-17|bc`
element=' '
print_element
echo " 88 88 88 88 88 88 "
cols=`tput cols`
cols=`echo $cols/2-17|bc`
element=' '
print_element
echo " 8888 88 88 88 88888 "
cols=`tput cols`
cols=`echo $cols/2-17|bc`
element=' '
print_element
echo " 88 88 888888888 88 88 "
cols=`tput cols`
cols=`echo $cols/2-17|bc`
element=' '
print_element
echo "88888888 88 88 88 88 888888"
echo ""
cols=`tput cols`
cols=`echo $cols/2-17|bc`
element=' '
print_element
echo "88 88 88 888 88888 888888"
cols=`tput cols`
cols=`echo $cols/2-17|bc`
element=' '
print_element
echo "88 88 88 88 88 88 88 88 "
cols=`tput cols`
cols=`echo $cols/2-17|bc`
element=' '
print_element
echo "88 8888 88 88 88 88888 8888 "
cols=`tput cols`
cols=`echo $cols/2-17|bc`
element=' '
print_element
echo " 888 888 888888888 88 88 88 "
cols=`tput cols`
cols=`echo $cols/2-17|bc`
element=' '
print_element
echo " 88 88 88 88 88 8888888 "
echo ""
fi
#PRINTING STAR WARS DONE
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment