On Thu, 7 Jul 2005, Jochen Baier wrote:
hi,
do you already thought about to have a folder related history ?
for example:
in folder: code/superprogram: i use the commands: make, ./superprogram
in folder: code/homepage: i use "scp index.html [EMAIL PROTECTED]" to upload
the next day, i go to "code/superprogram" folder and the bash history will
show
"make and ./superprogram" and in "code/homepage" arrow up key will show
"scp.."
would love to have something like that.
Untested; adjust to taste:
cd()
{
builtin cd "$1" &&
if [ ./.bash_history ]
then
history -c
history -r ./.bash_history
HISTFILE=./.bash_history
fi
case $PROMPT_COMMAND in
*history\ -a*) ;;
*) PROMPT_COMMAND="$PROMPT_COMMAND; history -a" ;;
esac
}
export -f cd
--
Chris F.A. Johnson <http://cfaj.freeshell.org>
==================================================================
Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress
<http://www.torfree.net/~chris/books/cfaj/ssr.html>
_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash