以脚本的方式回答了这个困扰多年的问题,尤其对于beginner!
(第9楼比楼上都深刻!)#!/bin/sh
# Which is better, GNOME or KDE ?
#
# Version : .013 beta
# Last changes : 3/6/2007
# http://linux.blowshard.net
#
# Not for use in a production environment
# Which is better, GNOME or KDE ?
#
# Version : .013 beta
# Last changes : 3/6/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
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
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))
;;
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 "Here are some other window managers :"
echo "http://en.wikipedia.org/wiki/Window_manager"
echo
exit 0
fi
;;
winner=$other
loser=$wmCheck
solved=$(($solved+1))
wmCheck=$other
happy_test=$(($happy_test+2))
if [ $happy_test = 4 ]; then
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 "Information about GNOME and KDE :"
echo "http://en.wikipedia.org/wiki/KDE"
echo "http://en.wikipedia.org/wiki/GNOME"
echo
exit 0
fi
;;
esac
wmCheck=$other
happy_test=$(($happy_test+3))
if [ $happy_test -gt 5 ]; then
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
if [ "$happy_test" -gt 2 ]; then
echo "$winner is better than $loser"
echo
else
echo "GNOME vs KDE = No Winner"
echo
fi
exit 0
脚本下载地址