#!/bin/bash

# april fool's joke

# author: Mateusz Adamowski
# based on idea by Wojtek Kaniewski


# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

clear

echo "Microsoft(R) Windows XP Server(TM)"			# not for real
echo "(C) Copyright 1985-2002 Microsoft Corporation"		# ...
echo 
echo

rcfile=`tempfile`

cat > $rcfile <<_EOF
alias "cls"="clear"
alias "nc"="mc"
alias ver="echo Microsoft\(R\) Windows XP Server\(TM\)"
alias dir="ls -al"
export PS1="C:\\_\e[D\e[D\\\$( pwd | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | sed -e 's/\//\*/g' | tr '*' '\' )>"

_EOF

win="cd.."
lin="cd .."

for a in `seq 1 10`
  do
  echo "alias '$win'='$lin'" >> $rcfile
  win=$win.
  lin=$lin/..
  done

letter=c
Letter=C

for a in `mount | grep "\(ext3\|ext2\|vfat\|xfs\|reiser\|nfs\|smb\)" | tr -s " " | cut -d " " -f 3`
  do
  echo "alias '$letter:'='cd $a'" >> $rcfile
  echo "alias '$Letter:'='cd $a'" >> $rcfile
  letter=`perl -e "print chr(ord($letter)+1)"`
  Letter=`perl -e "print chr(ord($Letter)+1)"`
  done



bash --rcfile $rcfile

rm $rcfile

