[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is there a way to also log PWD into syslog?
From: |
Chet Ramey |
Subject: |
Re: Is there a way to also log PWD into syslog? |
Date: |
Wed, 8 Sep 2021 10:19:21 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 |
On 9/8/21 10:07 AM, conan zhan wrote:
> I want to enrich logging this time by adding "Present Working Directory" of
> the
> user to the header
>
> "HISTORY: PID=%d UID=%d", getpid(), current_user.uid
>
> into -
>
>
> "HISTORY: PID=%d UID=%d PWD=%s", getpid(), current_user.uid,
> [thefunctiontogetPWD?]
>
> Is it possible to do this customization? Thanks.
Sure. You just have to get PWD (hint: the_current_working_directory).
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/