Hi,
I have a file which contains many occurances of a string say "hellosunil".
I want to insert a newline charcater after all the "hellosunil" strings in the file.
trying to use sed,
sed -e 's/hellosunil/\\nhellosunil/g' file1
sed help says u cannot substitute a regular expression... (6 Replies)
Dear all,
I have a file created in the name sample.txt in UNIX with header and footer. How to insert a required string (for example "FILE1") in the header part after the file has been created. What kind of command can i use to do the same.
Thanks in advance
Hari (3 Replies)
i have a file contains like this:
i want to create a script that will insert a comma "." after the 10th character so it would be look like this
thanks in advance (5 Replies)
Hello
Can somebody please help me with the following script?
I'm trying to create a text file with 20 blank lines and then insert a string in line 2 but nothing is printed in the itxtfile. I can create the file with 20 blank lines but when I "tell" it to print something on the second line, it... (4 Replies)
Hello Mates,
I have one txt file having commo seperated values. I have to insert string "FALSE" in 2nd field from the end. E.G
SE18 6RN,,,,5439070,1786840,,1000002148671600,123434
Out put should be:
SE18 6RN,,,,5439070,1786840,FALSE,1000002148671600,123434
Can some one help me to... (8 Replies)
Hi,
I have a very long pipe delimited string. The length of the string could vary. For example:
START|one|two|three|four|five|six|seven
START|one|two|three|four|five|six|seven|eight|nine
START|one|two|three|four
I want to replace in the third occurence of string with another... (9 Replies)
Hi everyone,
I am trying to insert a single very long string as the first line of a file,
So the following sed commands does what I want;
sed '1i\"","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"' file.txt
Think that all the... (3 Replies)
I am getting some values from a file and putting them in an array..but the null strings are not getting passed to the array. So during printing the elements ,the null string is not showing in the output. during array size calculation it is also excluding null.Please let me know how to do it.
# cat... (2 Replies)
Discussion started by: millan
2 Replies
LEARN ABOUT NETBSD
group
GROUP(5) BSD File Formats Manual GROUP(5)NAME
group -- format of the group permissions file
DESCRIPTION
The group file /etc/group 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 group file consists of newline separated ASCII records, usually one per group, containing four colon ':' separated fields. Each line has
the form:
group:passwd:gid:[member[,member]...]
These fields are as follows:
group Name of the group.
passwd Group's encrypted password.
gid The group's decimal ID.
member Group members.
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 associated with the group name. They should both be unique across the system (and often across a group of sys-
tems) 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 /etc/group file.
Very large groups can be accommodated over multiple lines by specifying the same group name in all of them; other than this, each line has an
identical format to that described above. This can be necessary to avoid the record's length limit, which is currently set to 1024 charac-
ters. Note that the limit can be queried through sysconf(3) by using the _SC_GETGR_R_SIZE_MAX parameter. For example:
biggrp:*:1000:user001,user002,user003,...,user099,user100
biggrp:*:1000:user101,user102,user103,...
The group with the name ``wheel'' has a special meaning to the su(1) command: if it exists and has any members, only users listed in that
group are allowed to su to ``root''.
HESIOD SUPPORT
If 'dns' is specified for the 'group' database in nsswitch.conf(5), then group lookups occur from the 'group' Hesiod domain.
NIS SUPPORT
If 'nis' is specified for the 'group' database in nsswitch.conf(5), then group lookups occur from the 'group.byname' and 'group.bygid' NIS
map.
COMPAT SUPPORT
If 'compat' is specified for the 'group' database, and either 'dns' or 'nis' is specified for the 'group_compat' database in
nsswitch.conf(5), then the group file may also contain lines of the format
+name:*::
which causes the specified group to be included from the 'group' Hesiod domain or the 'group.byname' NIS map (respectively).
If no group name is specified, or the plus sign (``+'') appears alone on line, all groups are included from the Hesiod domain or the NIS map.
Hesiod or NIS compat references may appear anywhere in the file, but the single plus sign (``+'') form should be on the last line, for his-
torical reasons. Only the first group with a specific name encountered, whether in the group file itself, or included via Hesiod or NIS,
will be used.
FILES
/etc/group
SEE ALSO newgrp(1), passwd(1), su(1), setgroups(2), crypt(3), initgroups(3), nsswitch.conf(5), passwd(5), yp(8)HISTORY
A group file format appeared in Version 6 AT&T UNIX.
The NIS file format first appeared in SunOS.
The Hesiod support first appeared in NetBSD 1.4.
BUGS
The passwd(1) command does not change the group passwords.
BSD June 21, 2007 BSD