#!/bin/bash

if [ -z "$1" ]
then
	echo 'syntax: capture histfile'
	exit 1
fi
[ -f "$1" ] && echo >> "$1"
export HISTFILE="$1"
export HISTFILESIZE=1000000
export HISTSIZE=1000000

# the following is an evil hack... easy way, anyone?
TEMP=`tempfile`
(cat ~/.bashrc ; echo 'export PS1="\[\033[1;36m\]'"$1"'\$\[\033[0m\] "') > $TEMP
(sleep 5; unlink $TEMP) &
exec bash --rcfile $TEMP
