User Tools

Site Tools


aix:user_profiles

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
aix:user_profiles [2021/01/01 21:21]
127.0.0.1 external edit
aix:user_profiles [2024/03/06 17:51] (current)
manu
Line 79: Line 79:
  
 BASH on AIX doesn'​t use /​etc/​*bash*,​ nor ~/​.bash_profile,​ **the only file specific is .bashrc** BASH on AIX doesn'​t use /​etc/​*bash*,​ nor ~/​.bash_profile,​ **the only file specific is .bashrc**
 +
 +===== Change historyfile =====
 +
 +If you need to adapt your history file depending on changing owner, like su or sudo
 +
 +Ex of addon to **/​etc/​profile**
 +<​code>​
 +...
 +
 +HOSTNAME=$(/​usr/​bin/​hostname -s)
 +PS1="​[\$LOGNAME@\$HOSTNAME]\$PWD#​ "
 +export PS1
 +
 +EDITOR=/​usr/​bin/​vi
 +export EDITOR
 +
 +alias ll='ls -lsa'
 +
 +# duration in sec 900 s = 15 min
 +TMOUT=7200
 +TIMEOUT=7200
 +typeset -r TMOUT
 +typeset -r TIMEOUT
 +
 +HISTSIZE=10000
 +EXTENDED_HISTORY=ON
 +HISTTIMEFORMAT="​%F %T "
 +
 +histdir=/​var/​history/​${USER}
 +mkdir -p $histdir
 +USER1=$(who am i | awk '​{print $1}')
 +if [ "​${USER1}"​ = ""​ ]
 +then
 +  HISTFILE=$histdir/​.sh_history_${USER}
 +else
 +  HISTFILE=$histdir/​.sh_history_${USER1}
 +fi
 +export HISTFILE
 +typeset -r HISTSIZE # put the variable in readonly
 +typeset -r EXTENDED_HISTORY
 +typeset -r HISTDATEFMT
 +
 +trap 1 2 3
 +</​code>​
aix/user_profiles.1609532499.txt.gz · Last modified: 2021/01/01 21:21 by 127.0.0.1