diff -uNr bash_completion/bash-completion.sh bash_completion-new/bash-completion.sh
--- bash_completion/bash-completion.sh	1969-12-31 19:00:00.000000000 -0500
+++ bash_completion-new/bash-completion.sh	2005-08-25 13:57:56.000000000 -0400
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+if test ${SHELL#*bin/} = "bash"; then
+       bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
+       if [ "$PS1" ] && [ $bmajor -eq 2 ] && [ $bminor '>' 04 ] \
+               && [ -f @PREFIX@/etc/bash_completion ]; then # interactive shell
+               # Source completion code
+               . @PREFIX@/etc/bash_completion
+       fi
+       if [ -f @PREFIX@/share/init/bash/completions ]; then
+               . @PREFIX@/share/init/bash/completions
+       fi
+       unset bash bmajor bminor
+fi
diff -uNr bash_completion/bash_completion bash_completion-new/bash_completion
--- bash_completion/bash_completion	2005-07-21 15:21:22.000000000 -0400
+++ bash_completion-new/bash_completion	2005-08-25 14:02:22.000000000 -0400
@@ -31,8 +31,8 @@
 {
   # These declarations must go within braces in order to be able to silence
   # readonly variable errors.
-  BASH_COMPLETION="${BASH_COMPLETION:-/etc/bash_completion}"
-  BASH_COMPLETION_DIR="${BASH_COMPLETION_DIR:=/etc/bash_completion.d}"
+  BASH_COMPLETION="${BASH_COMPLETION:-@PREFIX@/etc/bash_completion}"
+  BASH_COMPLETION_DIR="${BASH_COMPLETION_DIR:=@PREFIX@/etc/bash_completion.d}"
 } 2>/dev/null || :
 readonly BASH_COMPLETION BASH_COMPLETION_DIR
 
@@ -167,7 +167,7 @@
 
 # use GNU sed if we have it, since its extensions are still used in our code
 #
-[ $UNAME != Linux ] && have gsed && alias sed=gsed
+[ $UNAME != Linux ] && [ $UNAME != Darwin ] && have gsed && alias sed=gsed
 
 # This function checks whether a given readline variable
 # is `on'.
@@ -224,7 +224,9 @@
 #
 _configured_interfaces()
 {
-	if [ -f /etc/debian_version ]; then
+	if [ $UNAME eq "Darwin" ]; then
+		COMPREPLY=( $( /sbin/ifconfig | grep -E '^[^[:space:]]+:' | cut -d: -f1 ) )
+	elif [ -f /etc/debian_version ]; then
 		# Debian system
 		COMPREPLY=( $( sed -ne 's|^iface \([^ ]\+\).*$|\1|p' \
 			       /etc/network/interfaces ) )
@@ -339,8 +341,8 @@
 _services()
 {
 	local sysvdir famdir
-	[ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d
-	famdir=/etc/xinetd.d
+	[ -d @PREFIX@/etc/rc.d/init.d ] && sysvdir=@PREFIX@/etc/rc.d/init.d || sysvdir=@PREFIX@/etc/init.d
+	famdir=@PREFIX@/etc/xinetd.d
 	COMPREPLY=( $( builtin echo $sysvdir/!(*.rpmsave|*.rpmorig|*~|functions)) )
 
 	if [ -d $famdir ]; then
@@ -528,7 +530,7 @@
 # 'service' command and/or the SysV init.d directory, followed by
 # that script's available commands
 #
-{ have service || [ -d /etc/init.d/ ]; } &&
+{ have service || [ -d @PREFIX@/etc/init.d/ ]; } &&
 _service()
 {
 	local cur sysvdir
@@ -544,8 +546,8 @@
 	# don't complete past 2nd token
 	[ $COMP_CWORD -gt 2 ] && return 0
 
-	[ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d \
-				|| sysvdir=/etc/init.d
+	[ -d @PREFIX@/etc/rc.d/init.d ] && sysvdir=@PREFIX@/etc/rc.d/init.d \
+				|| sysvdir=@PREFIX@/etc/init.d
 
 	if [[ $COMP_CWORD -eq 1 ]] && [[ $prev == "service" ]]; then
 		_services
@@ -558,8 +560,8 @@
 	return 0
 } &&
 complete -F _service service
-[ -d /etc/init.d/ ] && complete -F _service $default \
-	$(for i in /etc/init.d/*; do echo ${i##*/}; done)
+[ -d @PREFIX@/etc/init.d/ ] && complete -F _service $default \
+	$(for i in @PREFIX@/etc/init.d/*; do echo ${i##*/}; done)
 
 # chown(1) completion
 #
@@ -850,7 +852,7 @@
 
 # Linux and FreeBSD killall(1) completion.
 #
-[ $UNAME = Linux -o $UNAME = FreeBSD ] &&
+[ $UNAME = Linux -o $UNAME = FreeBSD -o $UNAME = Darwin ] &&
 _killall()
 {
 	local cur
@@ -868,7 +870,7 @@
 
 	return 0
 }
-[ $UNAME = Linux -o $UNAME = FreeBSD ] && complete -F _killall killall pkill
+[ $UNAME = Linux -o $UNAME = FreeBSD -o $UNAME = Darwin ] && complete -F _killall killall pkill
 
 # Linux and FreeBSD pgrep(1) completion.
 #
@@ -2006,7 +2008,7 @@
 	if [ -n "$special" ]; then
 		case $special in
 		remove)
-			if [ -f /etc/debian_version ]; then
+			if [ -f /etc/debian_version ] || [ -x "@PREFIX@/bin/fink" ]; then
 				# Debian system
 				COMPREPLY=( $( _comp_dpkg_installed_packages \
 						$cur ) )
@@ -2143,7 +2145,7 @@
 have aptitude && {
 _comp_dpkg_hold_packages()
 {
-	grep -B 2 'hold' /var/lib/dpkg/status | grep "Package: $1" \
+	grep -B 2 'hold' @PREFIX@/var/lib/dpkg/status | grep "Package: $1" \
 		| cut -d\  -f2
 }
 
@@ -2304,7 +2306,7 @@
 	prev=${COMP_WORDS[COMP_CWORD-1]}
 
 	if [ "$prev" = "-s" ]; then
-	  if [ -f /etc/debian_version ]; then
+	  if [ -f /etc/debian_version ] || [ -x @PREFIX@/bin/fink ]; then
 	    COMPREPLY=( $( </etc/shells ) )
 	  else
 	    COMPREPLY=( $( chsh -l | grep "^$cur" ) )
@@ -2387,6 +2389,8 @@
 	kh=()
 
 	# ssh config files
+	[ -r @PREFIX@/etc/ssh/ssh_config ] &&
+	  config=( ${config[@]} @PREFIX@/etc/ssh/ssh_config )
 	[ -r /etc/ssh/ssh_config ] &&
 	  config=( ${config[@]} /etc/ssh/ssh_config )
 	[ -r ~/.ssh/config ] &&
@@ -2405,12 +2409,20 @@
 	if [ -r "$global_kh" ]; then
 	    kh=( "$global_kh" )
 	else
+	    [ -r @PREFIX@/etc/ssh/ssh_known_hosts ] &&
+	      kh=( ${kh[@]} @PREFIX@/etc/ssh/ssh_known_hosts )
 	    [ -r /etc/ssh/ssh_known_hosts ] &&
 	      kh=( ${kh[@]} /etc/ssh/ssh_known_hosts )
+	    [ -r @PREFIX@/etc/ssh/ssh_known_hosts2 ] &&
+	      kh=( ${kh[@]} @PREFIX@/etc/ssh/ssh_known_hosts2 )
 	    [ -r /etc/ssh/ssh_known_hosts2 ] &&
 	      kh=( ${kh[@]} /etc/ssh/ssh_known_hosts2 )
+	    [ -r @PREFIX@/etc/known_hosts ] &&
+	      kh=( ${kh[@]} @PREFIX@/etc/known_hosts )
 	    [ -r /etc/known_hosts ] &&
 	      kh=( ${kh[@]} /etc/known_hosts )
+	    [ -r @PREFIX@/etc/known_hosts2 ] &&
+	      kh=( ${kh[@]} @PREFIX@/etc/known_hosts2 )
 	    [ -r /etc/known_hosts2 ] &&
 	      kh=( ${kh[@]} /etc/known_hosts2 )
 	    [ -d /etc/ssh2/knownhosts ] &&
@@ -3325,8 +3337,8 @@
 {
 	local config
 
-	config=/etc/ssl/openssl.cnf
-	[ ! -f $config ] && config=/usr/share/ssl/openssl.cnf
+	config=@PREFIX@/etc/ssl/openssl.cnf
+	[ ! -f $config ] && config=/System/Library/OpenSSL/openssl.cnf
 	for (( i=2; i < COMP_CWORD; i++ )); do
 		if [[ "${COMP_WORDS[i]}" == -config ]]; then
 			config=${COMP_WORDS[i+1]}
@@ -4163,7 +4175,7 @@
 have dpkg && {
 _comp_dpkg_installed_packages()
 {
-	grep -A 2 "Package: $1" /var/lib/dpkg/status | \
+	grep -A 2 "Package: $1" @PREFIX@/var/lib/dpkg/status | \
 		grep -B 2 'ok installed' | grep "Package: $1" | cut -d\  -f2
 }
 
@@ -4854,6 +4866,7 @@
 	# find the admin dir
 	for i in alternatives dpkg/alternatives rpm/alternatives; do
 		[ -d /var/lib/$i ] && admindir=/var/lib/$i && break
+      [ -d "@PREFIX@/etc/$i" ] && admindir="@PREFIX@/etc/$i" && break
 	done
 	for (( i=1; i < COMP_CWORD; i++ )); do
 		if [[ "${COMP_WORDS[i]}" == --admindir ]]; then
@@ -8267,6 +8280,7 @@
 		    \"${cur#[\`\"\']}\" 2>/dev/null ) \
 		    $( compgen -d -- $cur ) )
 }
+
 list=( $( sed -ne '/^# START exclude/,/^# FINISH exclude/p' \
 	  $BASH_COMPLETION | \
 	# read exclusion compspecs
diff -uNr bash_completion/fink.sh bash_completion-new/fink.sh
--- bash_completion/fink.sh	1969-12-31 19:00:00.000000000 -0500
+++ bash_completion-new/fink.sh	2005-08-25 13:57:56.000000000 -0400
@@ -0,0 +1,128 @@
+#!/bin/bash
+
+# 
+# Copyright (c) 2004, Lukas Westermann <contact AT openos DOT ch>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without 
+# modification, are permitted provided that the following conditions 
+# are met:
+#   - Redistributions of source code must retain the above copyright 
+#     notice, this list of conditions and the following disclaimer.
+#   - Redistributions in binary form must reproduce the above 
+#     copyright notice, this list of conditions and the following 
+#     disclaimer in the documentation and/or other materials 
+#     provided with the distribution.
+#   - The names of its contributors may not be used to endorse or 
+#     promote products derived from this software without specific 
+#     prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
+# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
+# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+#
+# Completion for Fink command
+#
+# History
+# ---------------------------------
+# Version 1.0.0  - initial release
+# Version 1.0.1 - added test to check fink availability
+# Version 1.0.2 - simplified checks for fink availabiltiy
+# Version 1.0.3 - fixed problems with spaces in completion
+#
+
+[ $UNAME = Darwin ] && have fink && {
+_fink_installed() {
+    fink list -i --tab "$*" | cut -f2 2>/dev/null
+}
+
+_fink_all() {
+    apt-cache pkgnames "$*" 2>/dev/null
+}
+
+_fink_trees() {
+    cat @PREFIX@/etc/fink.conf | sed -e '/^Trees/!d; s/^Trees://' 2>/dev/null
+}
+
+_fink()
+{
+	local cur prev special i
+	
+	COMPREPLY=()
+	cur=${COMP_WORDS[COMP_CWORD]}
+	prev=${COMP_WORDS[COMP_CWORD-1]}
+
+	for (( i=0; i < ${#COMP_WORDS}-1; i++ )); do
+		if [[ ${COMP_WORDS[i]} == @(install|update|enable|activate|use|list|remove|disable|deactivate|unuse|delete \
+		                            |purge|apropos|describe|desc|description|info|fetch-missing|fetch \
+		                            |build|rebuild|reinstall|validate|check|scanpackages) ]]; then
+			special=${COMP_WORDS[i]}
+		fi
+	done
+
+	if [ -n "${special}" ]; then
+		case $special in
+		    install|enable|activate|use|apropos|describe|desc|description|info|fetch|build)
+			COMPREPLY=( $( _fink_all $cur ) )
+			;;
+		    remove|disable|deactivate|unuse|delete|purge|update|rebuild|reinstall)
+			COMPREPLY=( $( _fink_installed $cur ) )
+			;;		    
+		    fetch-missing)
+			COMPREPLY=( $( compgen -W '-i --ignore-restrictive' -- $cur ) )
+			;;
+		    validate|check)
+			local IFS=$'\t\n'
+			_filedir '@(deb|info)'
+			#COMPREPLY=( $( compgen -f -- $cur ) )
+			;;
+		    scanpackages)
+			COMPREPLY=( $( compgen -W '$( _fink_trees )' -- $cur ) )
+			;;
+		    list)
+			if [[ "$cur" == -* ]]; then
+			    # TODO: Fix problems with --tree=
+			    #if [[ $cur == --tree=* || $cur == -t=* ]]; then
+				#local pfx las #res
+                                #pfx=$( echo $cur | sed -e 's/^\([^=]*\)=.*$/\1/' )
+				#las=$( echo "$cur" | sed -e 's/^[^=]*=//' )
+				#[[ $las == $cur ]] && las=()
+				#res=$( cat @PREFIX@/etc/fink.conf | sed -e '/^Trees/!d; s/^Trees://' 2>/dev/null )
+                                #COMPREPLY=( $( compgen -W '$( _fink_trees )' -- "${las}" ) )
+			    #else
+				COMPREPLY=( $( compgen -W '-h --help -t --tab -i --installed -o --outdated -u --uptodate -n --notinstalled \
+                                                       -s --section -m --maintainer --tree -w --width' -- $cur ) )
+			    #fi
+			else
+			    COMPREPLY=( $( _fink_all $cur ) )
+			fi
+			;;
+		esac
+
+		return 0
+	fi
+
+	if [[ "$cur" == -* ]]; then
+		COMPREPLY=( $( compgen -W '-h -q -V -v -y --help --quite --version --verbose --yes' -- $cur ) )
+	else
+		COMPREPLY=( $( compgen -W 'install remove purge update selfupdate update-all configure list \
+		                           apropos describe fetch fetch-all fetch-missing index validate scanpackages \
+                                           build rebuild reinstall checksums cleanup' -- $cur ) )
+	fi
+
+	return 0
+}
+complete $filenames -F _fink fink
+}
\ No newline at end of file
diff -uNr bash_completion/open.sh bash_completion-new/open.sh
--- bash_completion/open.sh	1969-12-31 19:00:00.000000000 -0500
+++ bash_completion-new/open.sh	2005-08-25 13:57:56.000000000 -0400
@@ -0,0 +1,106 @@
+#!/bin/bash
+
+# 
+# Copyright (c) 2004, Lukas Westermann <contact AT openos DOT ch>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without 
+# modification, are permitted provided that the following conditions 
+# are met:
+#   - Redistributions of source code must retain the above copyright 
+#     notice, this list of conditions and the following disclaimer.
+#   - Redistributions in binary form must reproduce the above 
+#     copyright notice, this list of conditions and the following 
+#     disclaimer in the documentation and/or other materials 
+#     provided with the distribution.
+#   - The names of its contributors may not be used to endorse or 
+#     promote products derived from this software without specific 
+#     prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
+# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
+# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+#
+# Bash Auto-Completion for the NextStep command 'open'
+#
+# History
+# ----------------------------------
+# Version 1.0.0 - initial release
+# Version 1.0.1 - added test for availabilty (Darwin only
+#                 and check for open)
+# Version 1.0.2 - fixed problems with IFS for -a and -e
+# Version 1.0.3 - simplified availability check
+# Version 1.0.4 - fixed problem with spaces and completion
+#
+
+[ $UNAME = Darwin ] && have open && {
+_list_apps() {
+    local IFS=$'\n'
+    find '/Applications' "${HOME}"'/Applications' '/Developer/Applications' -name "${1}*.app" -maxdepth 2 2>/dev/null
+    #TODO: MS Word and other carbon apps...HOW ???
+}
+
+_open()
+{
+
+    local cur prev IFS=$'\t\n'
+    COMPREPLY=()
+    cur=${COMP_WORDS[COMP_CWORD]}
+    prev=${COMP_WORDS[COMP_CWORD-1]}
+
+    if [[ $prev == -a ]]; then
+	local res ncur
+	ncur=$( echo "$cur" | sed -e 's/\\//g' 2>/dev/null )
+	res=$( _list_apps "${ncur}" | sed -e 's/.*\/\([^\/]*\)\.app/\1/' )
+	COMPREPLY=( $( compgen -W "${res}" -- "${ncur}" ) )
+    elif [[ $prev == -e ]]; then
+	_filedir '@(txt|doc|rtf|rtfd|pdf|png|jpg|gif)'
+    elif [[ $cur == -* ]]; then
+	local IFS=$' \t\n'
+	COMPREPLY=( $( compgen -W '-a -e' -- "$cur" ) )
+    else
+	local first="${COMP_WORDS[1]}" second="${COMP_WORDS[2]}"
+	if [[ $first == -a ]]; then
+	    case "$second" in
+		QuickTime*)
+		    _filedir '@(mp3|mpg|mpeg|avi|m4*|mov|alc)'
+		    ;;
+		iTunes)
+		    _filedir '@(mp3|m4*|ogg|alc)'
+		    ;;
+		Safari|Mozilla|Camino|Opera|Firebird)
+		    # TODO: complete from history/bookmarks ?
+		    _filedir '@(htm|html|xhtm|xhtml|php|php3|php3|xml)'
+		    ;;
+		VLC)
+		    # TODO: complete for CD/DVD too...
+		    _filedir '@(avi|mpg)'
+		    ;;
+		BitTorrent*)
+		    _filedir '@(torrent)'
+		    ;;
+		*)
+		    # others, complete all
+		    _filedir
+		    ;;
+	    esac
+	else
+	    _filedir
+	fi
+    fi
+
+}
+complete $filenames -F _open open
+}
\ No newline at end of file
