Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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