###########################################################################
##
## This script sets up everything needed with zsh
## you can use it as your .zshrc, source it within the .zshrc
## or use it in profile.d, sourcing then with:
#
# for i in /etc/profile.d/* ; do
# 	if [ -r "$i" ]; then
# 		source $i
# 	fi
# done
#
##
## Don't execute the script! It won't work then!
##
###########################################################################
##
## Explanation of the tree structure
##
## All belonging parts are below
##
##	/zsh
## 
## that means below: user/zsh or system/zsh
##
##	system/zsh will be read first
##	user/zsh may override system/zsh environment
##
## if you need variables in a certain order, prefix them with numbers
## (they are not allowed for Environment anyway)
##
## This way it is guaranteed that the variables under user/env/env1 are
## set before those under user/env/env2, and before those under
## user/env/env3
##
## The folder user/zsh/alias contains keys to define shell aliases.
## For instance user/zsh/alias/ls may contain 'ls -Fh', to set an alias
## to the 'ls' command.
##
## Markus Raab 
## 12.06.2006
##
###########################################################################


if [ -z "$KDB" ]; then
	export KDB=`echo =kdb`
fi

echo "using $KDB as kdb commando"

#exports environment into the zsh
#s: short key name and make it shell like with quoting
#v: give value
#p: prefix this
$KDB ls user/zsh/env | while read key; do
	$(
	echo -n 'export '
	$KDB get -s $key
	)
done

#$KDB ls /zsh/alias | while read key; do
#	echo $key
#	$KDB get -s $key
#done

#leave KDB set...

