Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rice!uw-beaver!mit-eddie!wuarchive!sdd.hp.com!ucsd!pacbell.com!tandem!zorch!hico2!kak From: kak@hico2.UUCP (Kris A. Kugel) Newsgroups: comp.sys.3b1 Subject: Re: su and/or ksh change history file's group and ownership Summary: Yes, it's a pain. Possible simple solution! Message-ID: <1060@hico2.UUCP> Date: 14 Feb 91 22:44:06 GMT References: <1991Feb12.055727.23183@ms.uky.edu> Organization: High Country Software Lines: 35 In article <1991Feb12.055727.23183@ms.uky.edu>, amir@s.ms.uky.edu (Amir Sadr) writes: [ksh with su turns off the user's permission to write ksh history] I always find it a pain to go back to the old shell now that I'm used to ksh. Yes, I've had this problem. As a result, I've got the root default shell (in /etc/passwd) set to /bin/sh, since that won't change history. The culprit is the HISTFILE variable, you have to change that before you su. Maybe something like this: "HISTFILE=/tmp/.suhistory /bin/su" I have a vague recollection that this will spawn off the command with the HISTFILE variable changed in its environment, but will not change HISTFILE in the current environment. * * * * * * * * * * (two minutes pass) * * * * * * * * * * I just tried something similar to this, "HISTFILE=/tmp/.suhistory /bin/su root -c ksh" (some futzing to get ksh instead of sh for my su) This didn't change HISTFILE in the current environment, didn't change my history file permissions or ownership but did keep a history (numbered from one) maybe you can alias su to the earlier verion above and use su'd ksh that way. Jeez, thanks for asking, I'd just been living with the sub-optimal /bin/sh solution up to now. Now, I've got something better . . . . Kris A. Kugel ( 908 ) 842-2707 uunet!tsdiag.ccur.com!hico2!kak {daver,ditka,zorch}!hico2!kak internet: kak@hico2.westmark.com