set HIST="~/.history"
if (`wc --libxo text -l ${HIST} | cut -d '/' -f1` == 2000) then
mv ${HIST} ${HIST}.old
touch ${HIST} && chmod 600 ${HIST}
endif
I really like how well the autocompletion together with history on the default FreeBSD csh shell.
Wondering about the backup of command line history in .cshrc
set history = 8000
set savehist = (8000 merge)
So after 8000 commands it auto saves and starts a new .history file?
alias precmd 'history -S; history -M'
That is interesting. I had assumed env settings were on a per shell basis. I had no idea it was system-wideI also like to set the $HISTFILE variable, since it happens, from time to time, to switch shell
They are not system-wide -- setting an environment variable in your current shell won't affect running processes, or processes started from a different session. Each process has its own environment and each sub-process (a command you execute, like ls(1) or a shell/Perl/Python/whatever script) inherits environment of current shell/process. UsuallyThat is interesting. I had assumed env settings were on a per shell basis. I had no idea it was system-wide
set
builtin(1) prints current shell variables, whereas printenv(1) shows environment (exported) variables.That is interesting. I had assumed env settings were on a per shell basis. I had no idea it was system-wide