Sponsored Content
Full Discussion: Update NIS+ data
Operating Systems Solaris Update NIS+ data Post 302178829 by djunerup on Wednesday 26th of March 2008 11:37:44 AM
Old 03-26-2008
Update NIS+ data

Hi,

We are running NIS+ in our UNIX enviroment at work. I am now trying to add and update information in the passwd_org.dir file, but I'm not quite there yet...

If you type
Code:
niscat -o '[name=adam77],passwd.org_dir'

You can see all the fields you can modify..

Is there a way to update the information in the passwd_org.dir file for all the users in the database? What I want is to add som text in the 'gcos' table, the field where you can type some info about the user.

I can list all the users with
Code:
niscat passwd.org_dir| cut -d: -f1,5

, and then do some magic with 'sed', like so:
Code:
 niscat passwd.org_dir|cut -d: -f5 |sed 's/^/BK\/C\/\/DJ\/\+/g'

to add the desired text in front of all the rows. But how do I apply the changes back to NIS?

Can you add variables in to the 'nistbladm' command?


Thank you!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

NIS map mail.aliases specified, but NIS not running

Hi all, I just took over the admin role from someone and I wanna setup sendmail (just to send mail from the host) however, after I config all the resolv.conf, nssitch.conf, hosts file and when I try to send a mail out, after I punched ctl-D, it returned he following, "NIS map mail.aliases... (2 Replies)
Discussion started by: stancwong
2 Replies

2. Shell Programming and Scripting

How to compare data in two flat files and update them?

Hi All, I am giving an example similar to the problem I have. I have two data files of 10 columns each in which fields are delimited by comma(,). I need to compare compare the two files using the uniq col(col3). If there are any records in file1 and are not in file2 then I have check the value... (3 Replies)
Discussion started by: rajus19
3 Replies

3. UNIX for Advanced & Expert Users

SUSE 9 and 10 NIS clients with RedHat 8.0 NIS server not working

We have a RedHat 8.0 NIS master, with a RedHat 8.0 NIS Slave. We also have a small number of SUSE 9.1 and SUSE 10 machines here for evaluation. However, no matter what i do, the SUSE machines will not talk to the NIS Servers. If i broadcast for NIS Servers for the specified NIS domain, it... (1 Reply)
Discussion started by: fishsponge
1 Replies

4. Solaris

How to configure a NIS client bound to the NIS server in another subnet?

Hi, all. I have a Solaris client here needs to bind to NIS server in another subnet. Following is the configuration i made on the client, 1) edit /etc/inet/hosts to add an entry of the NIS server -- nserver01 2) execute `domainname` to set local NIS domain to the domain of the NIS server.... (1 Reply)
Discussion started by: sn_wukong
1 Replies

5. Solaris

NIS password file update issue

Hi Our nis server running on Sun solaris 8 operating system. I have added a new user in the nis passwd file & when I am trying to update the file from nis server by using following command: # cd /var/yp # make updated passwd It updates the passwd file but does not come back to command... (3 Replies)
Discussion started by: dolphin
3 Replies

6. Shell Programming and Scripting

data base update

hello everyone I need to update data base in file 1-ID 2-Name 3-ID group 4-ID teacher 5-mark list unique ID is (ID+ID group+ID teacher) we can append 5 th columns (marks list) main base file: Code: 1:John:3:1:4 3 2 2:Mark:1:2:1 3 3:Susan:3:4: input file: (1 Reply)
Discussion started by: mleplawy
1 Replies

7. Shell Programming and Scripting

How to update data between xml tags

Is there a way to modify Non Null data between <host> and </host> tags to a new value ?- may be using sed/awk? I tried this sed 's|.*<host>\(?*\)</host>.*|\<host>xxx</host>|' but it is updating the host which has null value - want opposite of this - Thanks in advance for you help!! For... (2 Replies)
Discussion started by: harry_todd
2 Replies

8. Shell Programming and Scripting

Validating that the NIS and NIS+ services are disabled

I'm creating a scrip for auditing our AIX box's to ensure that they are built according to our system standards. I'm not sure on the logic for checking to see if the NIS and NIS+ services are disabled. any idea's? (2 Replies)
Discussion started by: sport
2 Replies

9. Solaris

NIS slave unable to copy the data bases

Hi, I'm learning for my Solaris 10 sys-admin part 2. I'm now trying to get nis working because for the exercise. I run in to a problem. Setup: Three Systems solaris101 (client) Nothing wrong here havent made any config changes yet. solaris102 (master server) Interfaces ... (1 Reply)
Discussion started by: jld
1 Replies

10. Shell Programming and Scripting

Script to update data in a file

Hi, I need a script to update a line in a file with a file name everytime it runs. For example below are two files each files contains two rows(say 4&5) which needs to be updated with a file name abc.param xyz.param Now below are two filenames which have date and time appended to... (1 Reply)
Discussion started by: sv0081493
1 Replies
niscat(1)							   User Commands							 niscat(1)

NAME
niscat - display NIS+ tables and objects SYNOPSIS
niscat [-AhLMv] [-s sep] tablename... niscat [-ALMP] -o name... DESCRIPTION
In the first synopsis, niscat displays the contents of the NIS+ tables named by tablename. In the second synopsis, it displays the inter- nal representation of the NIS+ objects named by name. Columns without values in the table are displayed by two adjacent separator characters. OPTIONS
The following options are supported: -A Displays the data within the table and all of the data in tables in the initial table's concatenation path. -h Displays the header line prior to displaying the table. The header consists of the `#' (hash) character followed by the name of each column. The column names are separated by the table separator character. -L Follows links. When this option is specified, if tablename or name names a LINK type object, the link is followed and the object or table named by the link is displayed. -M Master server only. This option specifies that the request should be sent to the master server of the named data. This guarantees that the most up-to-date information is seen at the possible expense of increasing the load on the master server and increasing the possibility of the NIS+ server being unavailable or busy for updates. -o name Displays the internal representation of the named NIS+ object(s). If name is an indexed name (see nismatch(1)), then each of the matching entry objects is displayed. This option is used to display access rights and other attributes of individual columns. -P Follows concatenation path. This option specifies that the request should follow the concatenation path of a table if the initial search is unsuccessful. This option is only useful when using an indexed name for name and the -o option. -s sep This option specifies the character to use to separate the table columns. If no character is specified, the default separa- tor for the table is used. -v Displays binary data directly. This option displays columns containing binary data on the standard output. Without this option binary data is displayed as the string *BINARY*. EXAMPLES
Example 1: Displaying the contents of the hosts table example% niscat -h hosts.org_dir # cname name addr comment client1 client1 192.168.201.100 Joe Smith crunchy crunchy 192.168.201.44 Jane Smith crunchy softy 192.168.201.44 The string *NP* is returned in those fields where the user has insufficient access rights. Example 2: Displaying on the standard output Display the passwd.org_dir on the standard output. example% niscat passwd.org_dir Example 3: Displaying table contents Display the contents of table frodo and the contents of all tables in its concatenation path. example% niscat -A frodo Example 4: Displaying table entries Display the entries in the table groups.org_dir as NIS+ objects. Notice that the brackets are protected from the shell by single quotes. example% niscat -o '[ ]groups.org_dir' Example 5: Displaying the table object Display the table object of the passwd.org_dir table. example% niscat -o passwd.org_dir The previous example displays the passwd table object and not the passwd table. The table object includes information such as the number of columns, column type, searchable or not searchable separator, access rights, and other defaults. Example 6: Displaying the directory object Display the directory object for org_dir, which includes information such as the access rights and replica information. example% niscat -o org_dir ENVIRONMENT VARIABLES
NIS_PATH If this variable is set, and the NIS+ table name is not fully qualified, each directory specified will be searched until the table is found (see nisdefaults(1)). EXIT STATUS
niscat returns the following values: 0 Successful completion 1 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWnisu | +-----------------------------+-----------------------------+ SEE ALSO
nis+(1), nisdefaults(1), nismatch(1), nistbladm(1), nis_objects(3NSL), nis_tables(3NSL), attributes(5) NOTES
NIS+ might not be supported in future releases of the SolarisTM Operating Environment. Tools to aid the migration from NIS+ to LDAP are available in the Solaris 9 operating environment. For more information, visit http://www.sun.com/directory/nisplus/transition.html. SunOS 5.10 10 Dec 2001 niscat(1)
All times are GMT -4. The time now is 09:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy