zsh-workers
 help / color / mirror / code / Atom feed
From: "Joe D" <joe.divola@gmail.com>
To: zsh-workers@sunsite.dk
Subject: adding history logging "automagically" :)
Date: Mon, 9 Jul 2007 13:41:08 -0400	[thread overview]
Message-ID: <3cb6e920707091041t3b3f5c1cy7d7b08e6028c22f9@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1556 bytes --]

Hi all,
   We have two user accounts which groups use for a few diff purposes, and
to ease our debugging of what went wrong when things crash with our tools,
we want a nice easy way to find out what was last done on the system (as
opposed to the user not having any idea what the previous user did).  So
essentially, these two user accounts (who already use 'zsh') will always log
to a file that not everyone has to know about (just the support teams).
This doesn't take into account users who switch shells, etc, but this will
give us info for about 90% of our problems.

So in a nutshell, all I want to do is modify 'zsh' source to always do the
following options automatically (regardless of if these lines are present or
not):

HISTSIZE=1000
SAVEHIST=1000
HISTFILE=/opt/some_location/.user.log
setopt APPEND_HISTORY
setopt SHARE_HISTORY
setopt INC_APPEND_HISTORY

I've played around with hist.c & init.c with various functions and couldn't
quite get this behaviour, so I was hoping for a few pointers from anyone?
I've looked at 'init_misc' in init.c and tried simple things like:

    dosetopt(SHAREHISTORY, 1, 1);
    dosetopt(INCAPPENDHISTORY, 1, 1);

and in 'hist.c', I've used

char *new_hf = "/opt/some_location/.user.log"
setsparam("HISTFILE", ztrdup(new_hf));

in a few different places, but didn't seem to do the trick.  At this point,
i get a ".user.log.LOCK" file created in the proper place, but nothing gets
written to ".user.log" even after the shell is exitted.

Any suggestions/info/comments would be greatly appreciated.

Thanks,
Joe.

[-- Attachment #2: Type: text/html, Size: 2545 bytes --]

             reply	other threads:[~2007-07-09 17:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-09 17:41 Joe D [this message]
2007-07-10  0:47 ` Bart Schaefer
2007-07-10  1:27   ` Joe D

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3cb6e920707091041t3b3f5c1cy7d7b08e6028c22f9@mail.gmail.com \
    --to=joe.divola@gmail.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).