Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Local history



On Nov 19,  5:36pm, Peter Stephenson wrote:
} Subject: Re: Local history
}
} Bart Schaefer wrote:
} > 
} > 	local temphist=${TMPPREFIX}hist SAVEHIST=$HISTSIZE
} > 	HISTFILE=$temphist
} > 	fc -W				# Save internal history
} > 	local HISTSIZE=0		# Truncate internal history
} > 	HISTSIZE=$SAVEHIST
} > 	HISTFILE=~/.zcalc-history
} > 	fc -R				# Read previous zcalc history
} > 	# do zcalc stuff ...
} > 	fc -W				# Save zcalc history
} > 	HISTFILE=$temphist
} > 	fc -R				# Reload old history
} 
} That should obviously restore the original HISTFILE at the second last
} line.

Oops, well, yes, what's missing is that the second line should be

	local HISTFILE=$temphist

Originally I had that in the first `local', but then I decided to stuff
the name of the temp file into it's own variable rather than repeat it
twice, and then forgot to localize the assignment on the second line.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author