Bash Script : GNOME vs KDE

Answer the age old question.
Download script here.

#!/bin/sh
# Which is better, GNOME or KDE ?
#
# Version : .014 beta
# Last changes : 3/7/2007
# http://linux.blowshard.net
#
# Not for use in a production environment

ver=".013 beta"
wmCheck="GNOME"    #GNOME goes first…
echo
echo "KDE vs GNOME $ver"
echo
while [ "$solved" != "2" ]; do

	if [ "$wmCheck" = "GNOME" ]; then
		other="KDE"
		else
		other="GNOME"
	fi
echo "Does $wmCheck have the features you want ? "
echo -n "(Y)es (N)o (U)nsure : "
read bobloblaw	#Any Arrested Development fans ?
echo

case $bobloblaw in

	[Yy])
	winner=$wmCheck
	loser=$other
	wmCheck=$other
	solved=$(($solved+1))
	happy_test=$(($happy_test+1))
	;;

	[Nn])
	winner=$other
	loser=$wmCheck
	solved=$(($solved+1))
	wmCheck=$other
	happy_test=$(($happy_test+2))
		if [ $happy_test = 4 ]; then
		echo "GNOME vs KDE = No Winner"
		echo "Here are some other window managers :"
		echo "http://en.wikipedia.org/wiki/Window_manager"
		echo
		exit 0
		fi
	;;

	[Uu])

	solved=$(($solved+1))
	wmCheck=$other
	happy_test=$(($happy_test+3))
		if [ $happy_test -gt 5 ]; then
		echo "GNOME vs KDE = No Winner"
		echo "Information about GNOME and KDE :"
		echo "http://en.wikipedia.org/wiki/KDE"
		echo "http://en.wikipedia.org/wiki/GNOME"
		echo
		exit 0
		fi
	;;
esac

done
if [ "$happy_test" -gt 2 ]; then
echo "$winner is better than $loser"
echo
else
echo "GNOME vs KDE = No Winner"
echo
fi
exit 0
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Reddit
  • Digg
  • StumbleUpon
  • Technorati
  • Netscape
  • Fark
  • Slashdot

4 Comments so far

  1. Pete on March 6th, 2007

    do you a tcsh version of this script? :)

  2. shab. rm on March 8th, 2007

    #!/bin/sh
    # Which is better, GNOME or KDE ?
    #
    # Version : .014 beta
    # Last changes : 3/7/2007
    # http://linux.blowshard.net
    #
    # Not for use in a production environment

    ver=”.014 beta”
    wmCheck=”GNOME” #GNOME goes first…
    printf “\nKDE vs GNOME ${ver}\n\n”
    while ((solved!=2))
    do
    [[ “${wmCheck}” = “GNOME” ]] && other=”KDE” || other=”GNOME”
    printf “Does $wmCheck have the features you want ?\n”
    printf “(Y)es (N)o (U)nsure : ”
    read bobloblaw #Any Arrested Development fans ?
    printf “\n”

    case ${bobloblaw} in

    [Yy])
    winner=${wmCheck}
    loser=${other}
    wmCheck=${other}
    ((++solved,++happy_test))
    ;;

    [Nn])
    winner=${other}
    loser=${wmCheck}
    ((++solved,happy_test+=2))
    wmCheck=${other}
    if ((happy_test==4))
    then
    printf “GNOME vs KDE = No Winner\n”
    printf “Here are some other window managers :\n”
    printf “http://en.wikipedia.org/wiki/Window_manager\n\n”
    exit 0
    fi
    ;;

    [Uu])

    ((++solved,happy_test+=3))
    wmCheck=${other}
    if ((happy_test>5))
    then
    printf “GNOME vs KDE = No Winner\n”
    printf “Information about GNOME and KDE :\n”
    printf “http://en.wikipedia.org/wiki/KDE\n”
    printf “http://en.wikipedia.org/wiki/GNOME\n\n”
    exit 0
    fi
    ;;
    esac
    done
    ((happy_test>2)) && printf “${winner} is better than ${loser}\n\n” || \
    printf “GNOME vs KDE = No Winner\n\n”
    exit 0

  3. admin on March 10th, 2007

    Heh, no I don’t have a tcsh version of this script but I may port it to that one day :)

    Thanks to everyone for the votes.

  4. Dori on October 28th, 2008

    This is great info to know.

Leave a reply