HI-100

tom_tyler (C. Thomas Tyler)
C. Thomas Tyler created this job , modified by C. Thomas Tyler
Closed
HISTFILE setting in perforce_bashrc is not cross-Linux portable.

=== Customer-contributed comments ===
History is not kept for the perforce user on Ubuntu 20.04 with Helix Core/SDP

Default bashrc is setup with history settings that follow:
export HISTFILESIZE=5000
export HISTTIMEFORMAT="%Y/%m/%d %Z %H:%M:%S "
export HISTFILE="~/.hist/history.$$.$RANDOM"

When the shell attempts to write to the HISTFILE, the following error occurs:
perforce@aws-p4d1:/home/perforce history -a
-bash: history: ~/.hist/history.1029579.575: cannot create: No such file or directory

Unfortunately, this error is silent when the history is not manually written and no history is written on shell exit.

Updating the bashrc HISTFILE solves this issue:

export HISTFILE="$HOME/.hist/history.$$.$RANDOM"

Histories are now written and appear as expected.

=== Research ===

This has a good explanation - the quoting suppresses expansion of
the ~:
https://askubuntu.com/questions/1192981/why-isnt-tilde-recognised-as-home-folder-in-this-case

Better to fix this removing the quotes, as the HOME variable isn't
as reliably set as one would hope.
28925Fixed issue with HISTFILE on Ubuntu.

#review @d_benedict
28924Fixed issue with HISTFILE on Ubuntu.

#review-28925 @d_benedict
  • Details
  • Comments -
Status
Closed
Project
perforce_software-helix-installer
Severity
C
Reported By
C. Thomas Tyler
Reported Date
Modified By
C. Thomas Tyler
Modified Date
Owned By
tom_tyler
Component
env
Type
Bug