Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HISTFILE grows endlessly

7 views
Skip to first unread message

lo...@marco.de

unread,
Jan 8, 1996, 3:00:00 AM1/8/96
to
Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: SunOS4
Compiler: gcc
Compilation CFLAGS: -DHAVE_SETLINEBUF -DHAVE_VFPRINTF -DHAVE_UNISTD_H -DHAVE_STDLIB_H -DHAVE_LIMITS_H -DHAVE_GETGROUPS -DHAVE_RESOURCE -DHAVE_SYS_PARAM -DVOID_SIGHANDLER -DBSD_GETPGRP -DOPENDIR_NOT_ROBUST -DTERMIOS_LDISC -DINT_GROUPS_ARRAY -DHAVE_WAIT_H -DHAVE_GETWD -DHAVE_DUP2 -DHAVE_DIRENT -DHAVE_DIRENT_H -DHAVE_STRING_H -DHAVE_VARARGS_H -DHAVE_STRCHR -Dsparc -DSunOS4 -DSHELL -DHAVE_ALLOCA -DHAVE_ALLOCA_H -O -DDEFAULT_ECHO_TO_USG
uname output: SunOS ra 4.1.2 15 sun4c

Bash Version: 1.14
Patch Level: 6

Description:
bash 1.14.6 with HISTFILE exported.
If a shell script is executed, which "exec"s, the current history is
appended to $HISTFILE. This causes growth of $HISTFILE (only limited by
$HIST[FILE]SIZE), and big memory consumption for subshells.

Repeat-By:
$ bash -norc
bash$ export HISTFILE
bash$ rm -f $HISTFILE
bash$ echo 'exec /bin/ls' >/tmp/xxx
bash$ chmod +x /tmp/xxx
bash$ cat $HISTFILE
cat: /node/ra/louis/.bash_history: No such file or directory
bash$ /tmp/xxx
004 005 1 2 3 b0001 tools
bash$ cat $HISTFILE
export HISTFILE
rm $HISTFILE
echo 'exec /bin/ls' >/tmp/xxx
chmod +x /tmp/xxx
cat $HISTFILE
/tmp/xxx
bash$ /tmp/xxx
004 005 1 2 3 b0001 tools
bash$ cat $HISTFILE
export HISTFILE
rm $HISTFILE
echo 'exec /bin/ls' >/tmp/xxx
chmod +x /tmp/xxx
cat $HISTFILE
/tmp/xxx
export HISTFILE
rm $HISTFILE
echo 'exec /bin/ls' >/tmp/xxx
chmod +x /tmp/xxx
cat $HISTFILE
/tmp/xxx
cat $HISTFILE
/tmp/xxx
bash$ exit

Chet Ramey

unread,
Jan 9, 1996, 3:00:00 AM1/9/96
to
> Description:
> bash 1.14.6 with HISTFILE exported.
> If a shell script is executed, which "exec"s, the current history is
> appended to $HISTFILE. This causes growth of $HISTFILE (only limited by
> $HIST[FILE]SIZE), and big memory consumption for subshells.

This has already been fixed for the next major bash release.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, Case Western Reserve University Internet: ch...@po.CWRU.Edu

0 new messages