i am trying a simple thing but not able to do .
i want to track history when users login in env and do anything. there is one file , .profile which get executed on every login. i added below logic in the last of file -
Code:
MYSELF=`who am i -R`MY_TERM=`echo ${MYSELF}|awk '{print $1"."$6}'|tr -dc '[:alnum:][.]'`MY_TTY=`echo ${MYSELF}|awk '{print $2}'|sed 's#/#.#g'`LOG_DATE_TIME=$(date +"%d%m%Y_%H%M%S")HDIR="${HOME}/var/lsp/projs/op/history"mkdir -p ${HDIR}MYHFILE="${HDIR}/${MY_TERM}.${MY_TTY}.${LOG_DATE_TIME}.$$"touch ${MYHFILE}HISTFILE="${MYHFILE}"
so at desired location , i see new file created but of '0' size , data is not coming in this. if i check this on another account on same server(account- xdmadm) , their i see desired data in history file.
i find same value of eecho $HISTFILE on both accounts.
IMP - file owner of .profile is xdmadm . it's a link in my account pointing to xdmadm acocunt file.
Please suggest !!!
---------- Post updated at 02:26 PM ---------- Previous update was at 12:52 PM ----------
Hi Franklin , i dint understand you.
these are the commands , if i in any file which will export these variables in env. like as i mentioned,
.profile -> pointing to xdmadm user home dir ,
and so it is fine for xdmadm user , but not for this account. but it should be
Last edited by Franklin52; 07-21-2011 at 03:59 AM..
Reason: Please use code tags for code and data samples, thank you
I am pleased to announce this new video in 1080 HD for UNIX lovers honoring thirty years of UNIX history spanning from 1969 to 1999 presented in 150 seconds (two and a half minutes) in 1080 HD, celebrating the 50th anniversary of UNIX.
The Great History of UNIX (1969-1999) | 30 Years of UNIX... (8 Replies)
Hi all,
My need is :
1. To know who , when , which command used.
2. Local user should not delete this information.
I mean , with an example , i can say
i have a user user1
i need to give all the following permissions to user1, :
a. A specific directory other than his home... (1 Reply)
Hi Experts,
I am checking how to get day in Perl.
If it is “Monday” I need to process…below is the pseudo code.
Can you please prove the code for below condition.
if (today=="Monday" )
{
while (current_time LESS THAN 9:01 AM)
... (1 Reply)
Can anyone tell this:
If two users are logged into the same server from different locations. Is there a way to see the history command of the other user? I tried the history command, but it is showing me only the commands I used.
Thanks in advance for your help.
Iamnew2solaris (1 Reply)
Hi all,
My need is :
1. To know who , when , which command used.
2. Local user should not delete this information.
I mean , with an example , i can say
i have a user user1
i need to give all the following permissions to user1, :
a. A specific directory other than his home... (3 Replies)
Hello every body,
Kindly inform me How Do i find out the time I executed a command previously on UNIX Solaris??
To be more specific and more clear about what i want to know is that I want a command the enables me to know the history and which command i run at this history/time.
FYI I used... (5 Replies)
Advance Thanks.
(1) I would like to know any unix/Linux command to check EOF char in a file.
(2) Or Any way I can check a file has been reached completely at machine B from machine A. Note that machine A ftp/scp the file to machine B at unknown time. (5 Replies)
I wish to seach a Dir for a specific file, once the file is found i will perform additional logic. If the file is not found within two hours, i would like to exit.
Logically, I'm looking for the best way to approach this
Thanks for any assistance in advance.
Note: I'm using a C shell and... (2 Replies)