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

Re: HOW do i..

On Wed, Dec 27, 2000 at 10:31:46AM +0300, Andrej Borsenkow wrote:
> This can't be done, sorry. To save history entries in a file, this file should
> be user-writable. It does not matter, whom this file belongs to. History file
> is written (if at all) after every command. It means, user can edit it at any
> time and remove any entries. This applies to any logging.

Some operating systems allow you to set files append-only. For example,
under FreeBSD (and I think all 4.4-derived BSDs) the command "chflags
uappnd [file]" will set a file append-only, and only the owner or
superuser can remove the flag. "chflags sappnd [file]" and only the
superuser can remove the flag, and only if kern.securelevel is less
than one. I believe Linux has similar functionality.

I don't know whether or not this will work with the history mechanism.
If it can be set to append each line one at a time without trying to
re-write the entire file then it should work.

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