Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Search a file for certain strings and add them to the end of certain lines Post 302941976 by zaxxon on Thursday 23rd of April 2015 09:30:55 AM
Old 04-23-2015
Please use code tags in future - I edited your post accordingly.

Code:
$ awk '/GROUP/ {g=$1; next} {print $1,g}' OFS=\| infile
user1|GROUP1
user2|GROUP1
user3|GROUP1
user4|GROUP2
user5|GROUP2
user6|GROUP2
user7|GROUP3
user8|GROUP3

 

10 More Discussions You Might Find Interesting

1. HP-UX

Add a column at the end of all the lines in a file

Hi Guys, :D I am very much new to UNIX. I dont have much basics of coding in UNIX, so please help me out of thi ssituation. I have a file say for ex: ABC.dtd and it contains "|" delimited data as test1|testing|test3|moving past1|runing|test4|going I need to add a column at the end... (6 Replies)
Discussion started by: ruthless
6 Replies

2. Shell Programming and Scripting

different take on common ?: search for two strings and remove lines between them

Thank you for assisting, I've got a partial solution just needs a tweak. Hulk-BASH$ cat somefile.txt oh there is some stuff here some more stuff here START_LABEL stuff I want more stuff I want END_LABEL other stuff here too and even more stuff here too Hulk-BASH$ Hulk-BASH$ sed... (8 Replies)
Discussion started by: laser
8 Replies

3. Shell Programming and Scripting

awk how to search strings within a file from two different lines

Hi, i would really appreciate any help anyone can give with the following info. Thanks in advance. I need to run a search on a file that contains thousands of trades, each trade is added into the file in blocks of 25 lines. i know the search has to take place between a time stamp specified... (4 Replies)
Discussion started by: sp3arsy
4 Replies

4. Shell Programming and Scripting

Delete lines in file containing duplicate strings, keeping longer strings

The question is not as simple as the title... I have a file, it looks like this <string name="string1">RZ-LED</string> <string name="string2">2.0</string> <string name="string2">Version 2.0</string> <string name="string3">BP</string> I would like to check for duplicate entries of... (11 Replies)
Discussion started by: raidzero
11 Replies

5. Programming

search a file between two begin and end strings in c

Can any one help me out with following problem... I want to search in a file which has two strings repeat each time(like start and end) i want to search between these two string in C programming. please help me with the solution. thanks in advance. (8 Replies)
Discussion started by: uday.sena.m
8 Replies

6. Shell Programming and Scripting

search and replace, when found, delete multiple lines, add new set of lines?

hey guys, I tried searching but most 'search and replace' questions are related to one liners. Say I have a file to be replaced that has the following: $ cat testing.txt TESTING AAA BBB CCC DDD EEE FFF GGG HHH ENDTESTING This is the input file: (3 Replies)
Discussion started by: DeuceLee
3 Replies

7. Shell Programming and Scripting

awk to search similar strings and add their values

Hi, I have a text file with the following content: monday,20 tuesday,10 wednesday,29 monday,10 friday,12 wednesday,14 monday,15 thursday,34 i want the following output: monday,45 tuesday,10 wednesday,43 friday,12 (3 Replies)
Discussion started by: prashu_g
3 Replies

8. Shell Programming and Scripting

Search a string in a text file and add another string at the end of line

Dear All I am having a text file which is having more than 200 lines. EX: 001010122 12000 BIB 12000 11200 1200003 001010122 2000 AND 12000 11200 1200003 001010122 12000 KVB 12000 11200 1200003 In the above file i want to search for string KVB... (5 Replies)
Discussion started by: suryanarayana
5 Replies

9. UNIX for Dummies Questions & Answers

Add strings from one file at the end of specific lines in text file

Hello All, this is my first post so I don't know if I am doing this right. I would like to append entries from a series of strings (contained in a text file) consecutively at the end of specifically labeled lines in another file. As an example: - the file that contains the values to be... (3 Replies)
Discussion started by: gus74
3 Replies

10. Shell Programming and Scripting

Search for a Keyword in file and replace another keyword or add at the end of line

Hi I want to implement something like this: if( keyword1 exists) then check if(keyword2 exists in the same line) then replace keyword 2 with New_Keyword else Add New_Keyword at the end of line end if eg: Check for Keyword JUNGLE and add/replace... (7 Replies)
Discussion started by: dashing201
7 Replies
SSSD-SIMPLE(5)						   File Formats and Conventions 					    SSSD-SIMPLE(5)

NAME
sssd-simple - the configuration file for SSSD's 'simple' access-control provider DESCRIPTION
This manual page describes the configuration of the simple access-control provider for sssd(8). For a detailed syntax reference, refer to the "FILE FORMAT" section of the sssd.conf(5) manual page. The simple access provider grants or denies access based on an access or deny list of user or group names. The following rules apply: o If all lists are empty, access is granted o If any list is provided, the order of evaluation is allow,deny. This means that any matching deny rule will supersede any matched allow rule. o If either or both "allow" lists are provided, all users are denied unless they appear in the list. o If only "deny" lists are provided, all users are granted access unless they appear in the list. CONFIGURATION OPTIONS
Refer to the section "DOMAIN SECTIONS" of the sssd.conf(5) manual page for details on the configuration of an SSSD domain. simple_allow_users (string) Comma separated list of users who are allowed to log in. simple_deny_users (string) Comma separated list of users who are explicitly denied access. simple_allow_groups (string) Comma separated list of groups that are allowed to log in. This applies only to groups within this SSSD domain. Local groups are not evaluated. simple_deny_groups (string) Comma separated list of groups that are explicitly denied access. This applies only to groups within this SSSD domain. Local groups are not evaluated. Specifying no values for any of the lists is equivalent to skipping it entirely. Beware of this while generating parameters for the simple provider using automated scripts. Please note that it is an configuration error if both, simple_allow_users and simple_deny_users, are defined. EXAMPLE
The following example assumes that SSSD is correctly configured and example.com is one of the domains in the [sssd] section. This examples shows only the simple access provider-specific options. [domain/example.com] access_provider = simple simple_allow_users = user1, user2 SEE ALSO
sssd(8), sssd.conf(5), sssd-ldap(5), sssd-krb5(5), sssd-simple(5), sssd-ipa(5), sssd-ad(5), sssd-sudo(5),sss_cache(8), sss_debuglevel(8), sss_groupadd(8), sss_groupdel(8), sss_groupshow(8), sss_groupmod(8), sss_useradd(8), sss_userdel(8), sss_usermod(8), sss_obfuscate(8), sss_seed(8), sssd_krb5_locator_plugin(8), sss_ssh_authorizedkeys(8), sss_ssh_knownhostsproxy(8),pam_sss(8). AUTHORS
The SSSD upstream - http://fedorahosted.org/sssd SSSD
06/17/2014 SSSD-SIMPLE(5)
All times are GMT -4. The time now is 04:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy