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

Re: can't write zsh_history



Michael Hernandez wrote:
> The problem, which is really more of an annoyance than a problem, is  
> that if I su to run some command and I don't cd first,  
> my .zsh_history file becomes owned by root. After I exit from # and  
> run a command as my regular user, zsh tells me that it can't write  
> the history file, which of course it can't because it's now owned by  
> root. Is there something I can do to alter the way zsh writes to my  
> history file when I am root?

if (( ! EUID )); then
  HISTFILE=~/.history_root
else
  HISTFILE=~/.history
fi

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php



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