Clearly, I've not been my best on this problem. After further testing, I found another bug.
should be:
Then later, I have exit(0) in an awk. The problem is, the exit(1) in the END{ } block will get executed regardless. To avoid this, the exit must specify a latched value. So the proper line should be:
Then I noticed that sometimes the username is listed twice in update.txt, so that the FILED1=`...` ends up with multiple lines of output. Also, in case the comment varies by hostname, the awk should be more selective. Here's the fix for that:
I have edited the original post respectively.
Hello, was looking for some help on extracting a field from the passwd file.
So far I have made a copy of the passwd file and changed my rights so I can edit it. Every user's password is coded as an :x:, and my goal was to change that x to a blank, and then try to extract any user with that field... (2 Replies)
Hi
can anyone help me regarding the meaning of the following lint messages.
what is the use of having such lint comments in the c program.
/*lint -esym(534,cputs,fgets,cprintf) */
/*lint -efile(766,pragmas.h) */
Thanks a lot in advance. (5 Replies)
Hello,
I read and search through this wonderful forum and tried different approaches but it seems I lack some knowledge and neurones ^^
Here is what I'm trying to achieve :
file1:
test filea 3495;
test fileb 4578;
test filec 7689;
test filey 9978;
test filez 12300;
file2:
test filea... (11 Replies)
Hi there,
I have more that 300 servers that I need to updated the comments field on /etc/passwd for users that have a blank comments fields. The users have accounts on different servers. I have created a list of these users on a text file called update_passwd.txt.
I need a script that will... (6 Replies)
Hi Experts,
I have a requirement where i need to update the below items in file,
1. END TIME
2. PREV_STATUS
For the first time the PREV_status and end time of all job the job will be sysdate & NULL reply as below,
Session_name,Load Type,Frequency,Seesion End time,Prev_Status... (2 Replies)
I must write a script to change all C++ like comments:
// this is a comment
to this one
/* this is a comment */
How to do it by sed? With file:
#include <cstdio>
using namespace std; //one
// two
int main() {
printf("Example"); // three
}//four
the result should be: (2 Replies)
Hi Folks,
I have Solaris 10, latest release.
We have passwd aging set in /etc/defalut/passwd.
I have an account that passwd should never expire. Acheived by emptying associated users shadow file entries for passwd aging.
When I reset the users passwd using passwd command, it re enables... (3 Replies)
Hello i am back :D,
i have a prolem. I want to Delete the IPs which are in Comments.
Input
192.168.0.1
192.168.0.2
#192.168.0.3
#192.168.0.4 - when TAB or Space, delete too.
/*192.168.0.5
192.168.0.6
192.168.0.7*\
Output
192.168.0.1
192.168.0.2
My solution is sed -e... (7 Replies)
Hi,
I have a Solaris 10 box where password aging is not functioning properly. Using the passwd command with the -l or -u options causes the lastchg field in the /etc/shadow file to be modified. Therefore, if a user's password is set to expire in 90 days and they are 1 day away, all they have... (4 Replies)
Discussion started by: cschar
4 Replies
LEARN ABOUT FREEBSD
group
GROUP(5) BSD File Formats Manual GROUP(5)NAME
group -- format of the group permissions file
DESCRIPTION
The group file is the local source of group information. It can be used in conjunction with the Hesiod domain `group', and the NIS maps
`group.byname' and `group.bygid', as controlled by nsswitch.conf(5).
The file group consists of newline separated ASCII records, one per group, containing four colon ':' separated fields. These fields are as
follows:
group Name of the group.
passwd Group's encrypted password.
gid The group's decimal ID.
member Group members.
Lines whose first non-whitespace character is a pound-sign (#) are comments, and are ignored. Blank lines that consist only of spaces, tabs
or newlines are also ignored.
The group field is the group name used for granting file access to users who are members of the group. The gid field is the number associ-
ated with the group name. They should both be unique across the system (and often across a group of systems) since they control file access.
The passwd field is an optional encrypted password. This field is rarely used and an asterisk is normally placed in it rather than leaving
it blank. The member field contains the names of users granted the privileges of group. The member names are separated by commas without
spaces or newlines. A user is automatically in a group if that group was specified in their /etc/passwd entry and does not need to be added
to that group in the group file.
IMPLEMENTATION NOTES
The passwd(1) command does not change the group passwords. The pw(8) utility's groupmod command should be used instead.
LIMITS
There are various limitations which are explained in the function where they occur; see section SEE ALSO.
In older implementations, a group cannot have more than 200 members. The maximum line length of /etc/group is 1024 characters. Longer lines
will be skipped. This limitation disappeared in FreeBSD 3.0. Older binaries that are statically linked, depend on old shared libraries, or
non-FreeBSD binaries in compatibility mode may still have this limit.
FILES
/etc/group
SEE ALSO newgrp(1), passwd(1), setgroups(2), crypt(3), getgrent(3), initgroups(3), nsswitch.conf(5), passwd(5), chkgrp(8), pw(8), yp(8)HISTORY
A group file format appeared in Version 6 AT&T UNIX. Support for comments first appeared in FreeBSD 3.0.
BSD February 8, 2013 BSD