From: cbaker@GOODYEAR.COM
Date: Wed Oct 15 2003 - 16:38:57 EDT
Vipin,
There are number of ways to get the results you want. Actually depends on
the situation and how much work you want to do.
For instance, if you have a number of users with $HOME in "/home" and you
want to know who has "TBL_LOG" in their .profile, a quick and dirty way is
to run this:
cd /home
grep TBL_LOG */.profile
What you will get is the hit, but each will be proceeded by the
directory/.profile - The "directory" being ALISON, BOB, etc.
If that is too long or if the .profile are in various directories, then you
could do a FOR LOOP with the various directories. In the FOR LOOP, if you
find a hit with the grep command, well you know whose it is based on which
value you are using at that point in the for loop.
Example:
for dir in `cat list_of_directories`
do
grep -l TBL_LOG ${dir}/.profile
done
This would take the list of directories and one at a time grep for the
TBL_LOG. The grep with the -l (lower case L) just prints out the filename
that passes the grep. So you will get only the files (and directory) that
has TBL_LOG in it.
If you have need of other methods, just write.
Christopher M. Baker
Senior Technical Support Analyst
DSE/TCO
Goodyear Tire and Rubber Company
=================================================
Contains Confidential and/or Proprietary Information.
May not be copied or disseminated without the expressed
written consent of The Goodyear Tire & Rubber Company.
=================================================
John Jolet
<john.jolet@FXFN To: aix-l@Princeton.EDU
.COM> cc: (bcc: Chris Baker/NA/GDYR)
Sent by: IBM AIX Subject: Re: extracting information from .profile
Discussion List
<aix-l@Princeton
.EDU>
10/15/2003 01:36
PM
Please respond
to IBM AIX
Discussion List
cat .profile|grep TBL_LOG
-----Original Message-----
From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU]On Behalf Of
Vipin Khushu
Sent: Wednesday, October 15, 2003 11:57 AM
To: aix-l@Princeton.EDU
Subject: extracting information from .profile
Does anyone have a way to extract into a text file a particular line from
the .profile of a user and then show that the line extracted belongs to the
user from whose .profile the line was extracted.
For example,
# cd ALISONS
# ls
.profile fax
# more .profile
export TBL_LOG=T1 <<<< this is the line I need to extract then correlate
it to ALISONS
export TERM=vt100
...
...
...
exit
TIA
Vipin
This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:17 EDT