11-13-2012
Where does id / getent query ?
I'm typing "id <user's id>" and its returning a different UID that what is defined in our administration system. Where does id / getent query and where is it configured to query? I'm guessing it queries the local /etc/passwd file first, and then if it doesn't find anything it would query LDAP correct?
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi friends i want to know details of `exec` exact use of this command .....
actually i went through the man page but i didn`t get the satisfactory ...conclusion....
thaks in advance.... (1 Reply)
Discussion started by: newson
1 Replies
2. UNIX for Dummies Questions & Answers
I just started to learn unix -
need help to write a script to query a logfile and produce the results that
contains a specific word "alarm" for a period from X day to Y day.
I really have no idea how to begin - :(
please help...
____________________________________________________
#... (1 Reply)
Discussion started by: snipfer
1 Replies
3. Shell Programming and Scripting
I would like to use the result of a query in another query. How do I redirect/add the output to another variable?
$result = odbc_exec($connect, $query);
while ($row = odbc_fetch_array($result)) {
echo $row,"\n";
}
odbc_close($connect);
?>
This will output hostnames:
host1... (0 Replies)
Discussion started by: hazno
0 Replies
4. Shell Programming and Scripting
Hi,
I have a requirement as below which needs to be done viz UNIX shell script
(1) I have to connect to an Oracle database
(2) Exexute "SELECT field_status from table 1" query on one of the tables.
(3) Based on the result that I get from point (2), I have to update another table in the... (6 Replies)
Discussion started by: balaeswari
6 Replies
5. Shell Programming and Scripting
hi
i want to make script. where i want to query from the user yes or no
exp: do you want to proceed :
y for yes
n for NO.
how this is possible in unix (3 Replies)
Discussion started by: dodasajan
3 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I have a script to remove null values from a file. Could any one explain how this is working? :confused:
while read f
do
echo process $f
gawk... (0 Replies)
Discussion started by: abhi_n123
0 Replies
7. Shell Programming and Scripting
Hi,
I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database.
For instance:
USER CITY
--------- ----------
A CITY_A
B CITY_B
C ... (2 Replies)
Discussion started by: DevendraG
2 Replies
8. Solaris
Hello, thanks in advance for any help!
We use LDAP for our unix boxes
When I run getent passwd on solaris 10, it only returns some of the ldap entries, not all. Aprox 300 of 4000. When i run the same command on linux or solaris 9, it comes back correct.
my nsswitch file is good.
I ran a... (6 Replies)
Discussion started by: BG_JrAdmin
6 Replies
9. Shell Programming and Scripting
korn shell script on Solaris
getent hosts <hostname> returns
IP FQDN
But I just want the output to be like this
<hostname> IP
things I have tried so far
getent hosts <hostname> |awk '{print $2,$1}'
using awk and substr
getent hosts <hostname> |nawk '{print substr($2,1,5)}'
... (1 Reply)
Discussion started by: snoman1
1 Replies
LEARN ABOUT FREEBSD
getent
GETENT(1) BSD General Commands Manual GETENT(1)
NAME
getent -- get entries from administrative database
SYNOPSIS
getent database [key ...]
DESCRIPTION
The getent utility retrieves and displays entries from the administrative database specified by database, using the lookup order specified in
nsswitch.conf(5). The display format for a given database is as per the ``traditional'' file format for that database.
The database argument may be one of:
Database Display format
ethers address name
group group:passwd:gid:[member[,member]...]
hosts address name [alias ...]
networks name network [alias ...]
passwd user:passwd:uid:gid:gecos:home_dir:shell
protocols name protocol [alias ...]
rpc name number [alias ...]
services name port/protocol [alias ...]
shells /path/to/shell
utmpx [time] type: properties
If one or more key arguments are provided, they will be looked up in database using the appropriate function. For example, ``passwd'' sup-
ports a numeric UID or user name; ``hosts'' supports an IPv4 address, IPv6 address, or host name; and ``services'' supports a service name,
service name/protocol name, numeric port, or numeric port/protocol name.
If no key is provided and database supports enumeration, all entries for database will be retrieved using the appropriate enumeration func-
tion and printed.
EXIT STATUS
The getent utility exits 0 on success, 1 if there was an error in the command syntax, 2 if one of the specified key names was not found in
database, or 3 if there is no support for enumeration on database.
SEE ALSO
getutxent(3), ethers(5), group(5), hosts(5), networks(5), nsswitch.conf(5), passwd(5), protocols(5), rpc(5), services(5), shells(5)
HISTORY
A getent command appeared in NetBSD 3.0, and was imported into FreeBSD 7.0. It was based on the command of the same name in Solaris and
Linux.
BSD
August 24, 2005 BSD