Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!lavaca.uh.edu!uhnix1!moray!siswat!buck From: buck@siswat.UUCP (A. Lester Buck) Newsgroups: comp.unix.questions Subject: Re: no command history with ksh as root? Message-ID: <499@siswat.UUCP> Date: 12 Feb 90 16:44:41 GMT References: <497@siswat.UUCP> <720012@hpcljws.HP.COM> Organization: Photon Graphics, Houston Lines: 21 In article <720012@hpcljws.HP.COM>, jws@hpcljws.HP.COM (John Stafford) writes: > The reason ksh wants HISTFILE set for root is that it is deemed impolite > to automatically write the history file for a root user. That root user > might be trying to repair a file system and writing history to that file > system would be unfriendly. While this might make some sense, this was not the problem, since ksh was happily writing my /.sh_history file, it just wouldn't let me edit it. Thanks to the several people who sent me suggestions that I needed to set HISTFILE explicitly, and that does solve the access problem. Larry Jones (scjones@sdrc.uu.net) had the most reasonable guess for this behaviour: Not having source code I can't say for sure, but it looks to me like a simple bug in ksh. My guess is it uses "$HOME/.sh_history" as the name of the history file which, if you're root, turns out to be "//.sh_history" which don't work too good. -- A. Lester Buck buck@siswat.lonestar.org ...!texbell!moray!siswat!buck