Sponsored Content
Top Forums Shell Programming and Scripting Find and Replace Pattern in file Post 302967005 by djzah on Thursday 18th of February 2016 02:28:06 PM
Old 02-18-2016
Sorry Rudi... I pasted the content in the first post.. i suppose i should of just attached the txt file.

contents of useraudit.txt
Code:
auth user SVC_Qualys {
    description "SVC_Qualys"
    role guest
auth user admin {
    description "Admin User"
    role admin
auth user svc_redseal {
    description "svc_redseal"
    role resource-admin

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find and replace a pattern in a file

Hi I am having 2 files file1.c and file2.c Now i want to find all the occurances of pattern "abc" in file1.c, file2.c and replace with pattern "def" using shell script without using sed and with using sed. Thanks in advance... raju (1 Reply)
Discussion started by: krishnamaraju
1 Replies

2. Shell Programming and Scripting

Find a pattern and replace using sed.

Hi I need to help on finding the below pattern using sed <b><a href="/home/document.do?assetkey=x-y-abcde-1&searchclause=photo"> and replace as below in the same line on the index file. <b><a href="/abcde.html"> thx in advance. Mari (5 Replies)
Discussion started by: maridhasan
5 Replies

3. Shell Programming and Scripting

Error: Find the pattern in the file and replace

Hi all, I have requirement where i need to find a pattern and replace it by new word. I used the below perl command echo `perl -p -i -e "s/AbCdEf/PqRsTu/g;" FileName.txt` But I am getting an error as below Can't do inplace edit Not a Owner and the file FileName.txt gets ... (9 Replies)
Discussion started by: shreekrishnagd
9 Replies

4. Shell Programming and Scripting

Find and replace pattern in VI editor

All, I have a text file which has the following data X_SQL_13,X_SQL_14,X_SQL_15,X_SQL_16,X_SQL_17,X_SQL_18,X_SQL_19,X_SQL_20,X_SQL_21,X_SQL_22,X_SQL_23,X_SQL_24,X_SQL_25,X_SQL_26,X_SQL_27,... (4 Replies)
Discussion started by: thana
4 Replies

5. Shell Programming and Scripting

find a pattern and replace

i have a file which contains lines like this. intsrcrpttrn1099mctrl:export GRAPHPARM_AR="-input_code M302023" intsrcrpttrn1099mload:export GRAPHPARM_AR="-input_code M192023" intsrcrpttrn1099mload:export GRAPHPARM_AR="-input_code P192023" the value after -input_code starts with some alphabet... (4 Replies)
Discussion started by: dr46014
4 Replies

6. Shell Programming and Scripting

Find and Replace pattern in lowercase

I have an xml file. I need to convert a particular pattern to lower case and add 1 to it. For example my sample values in file are: ergeAAwrgersc_DWSTAGE_AC_DBO_TBL_GROUPZONES_INITIAL.badAAergerg sc_DWSTAGE_AC_DBO_TBL_SECTIONDEPENDENCY_INITIAL.badeAAwrgewrg... (6 Replies)
Discussion started by: alfredo123
6 Replies

7. Shell Programming and Scripting

how to find the pattern inside the file and replace it

hello everybody, I have a group of file eg- sample1 sample2 sample3 sample4 each file contain this :- cat sample1 SEQ_NUM,1,UPESI1 My requirement is to change the value-UPESI1 to UPE10 in file which contain this pattern -UPESI1. any help is appreciated. (2 Replies)
Discussion started by: abhigrkist
2 Replies

8. Shell Programming and Scripting

find pattern and replace the text before it

i am editing a big log file with the following pattern: Date: xxxx Updated: name Some log file text here Date: eee Updated: ny Some log file text here Basically i want to remove all the text in a line before the "Updated" pattern. I sill want to print the other... (4 Replies)
Discussion started by: balan1983a
4 Replies

9. Shell Programming and Scripting

sed find/replace a pattern, but not this one..

I've got a file like so: ...lots of lines, etc. push "route 10.8.0.0 255.255.255.0" push "route 192.168.1.123 255.255.255.0" ...lots of lines, etc. I want to sed find/replace the IP address in the second line, whatever it is, with a new IP address, but I don't want to touch the first line.... (5 Replies)
Discussion started by: DaHai
5 Replies

10. Shell Programming and Scripting

Search pattern then find and replace

If condition satisfy, want to find pattern and modify two Fields in Modify.txt Input.txt SOURCE1 SOURCE2 SOURCE3 SOURCE4 SOURCE5 SOURCE6 Modify.txt SOURCE1|SLA|2016/12/11 11:12:11 PM|HMM|11-11-16| SOURCE2|SLA|2016/13/11 11:12:11 PM|HMM|10-11-16| SOURCE3|SLA|2016/14/11 11:12:11... (7 Replies)
Discussion started by: Joselouis
7 Replies
LedgerSMB::DBObject::Admin(3pm) 			User Contributed Perl Documentation			   LedgerSMB::DBObject::Admin(3pm)

NAME
LedgerSMB::DBObject::Admin - User/group management for LedgerSMB SYNOPSIS
User/group management for LedgerSMB INHERITS
Universal LedgerSMB LedgerSMB::DBObject METHODS
save_user Saves a user optionally with location and contact data. If the password or import hash values is set, will not save contact or address information. This API is not fully documented at this time because it is expected that it will be broken down into more manageable chunks in future versions. Please do not count on the behavior. delete_user($delete_role) Deletes a user specified by $self->{user_id}. if $delete_role is true, deletes the role too. search_users Returns a list of users matching search criteria, and attaches that list to the user_results hash value. Search criteria: username first_name last_name ssn dob Undef matches all values. All matches exact except username which allows for partial matches. list_sessions returns a list of active sessions, when they were last used, and how many discretionary locks they hold. The list is also attached to the active_sessions hash value. No inputs required or used. delete_session Deletes a session identified by the session_id hashref. save_roles Saves the roles assigned to a user. Each role is specified as a hashref true value, where the key is the full name of the role (i.e. starting with lsmb_[dbname]__). get_salutations Returns a list of salutation records from the db for the dropdowns. get_roles Returns a list of role names with the following format: {role => $full_role_name, description => $short_role_name} The short role name is the full role name with the prefix removed (i.e. without the lsmb_[dbname]__ prefix). get_countries Returns a reference to an array of hashrefs including the country data in the db. Sets the same reference to the countries hash value. get_contact_classes Returns a list of hashrefs ({id =>, class =>}) relating to the contact classes. COPYRIGHT
Copyright (c) 2009, the LedgerSMB Core Team. This is licensed under the GNU General Public License, version 2, or at your option any later version. Please see the accompanying License.txt for more information. perl v5.14.2 2012-03-25 LedgerSMB::DBObject::Admin(3pm)
All times are GMT -4. The time now is 08:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy