Sponsored Content
Full Discussion: Pattern search
Top Forums UNIX for Dummies Questions & Answers Pattern search Post 302654297 by saj on Monday 11th of June 2012 01:30:48 PM
Old 06-11-2012
Pattern search

Hi All ,

Please let me know how to get the below scenario done .

Below is the file pattern which I have ...

Code:
      BEGIN DSSUBRECORD
         Name "a"
         Prompt "b"
         Default "c"
         ParamType "0"
         ParamLength "0"
         ParamScale "0"
      END DSSUBRECORD
      BEGIN DSSUBRECORD
         Name "d"
         Prompt "e"
         Default "f"
         ParamType "0"
         ParamLength "0"
         ParamScale "0"
      END DSSUBRECORD
      BEGIN DSSUBRECORD
         Name "g"
         Prompt "h"
         Default "i"
         ParamType "0"
         ParamLength "0"
         ParamScale "0"
      END DSSUBRECORD
      BEGIN DSSUBRECORD
         Name "j"
         Prompt "k"
         Default "l"
         ParamType "0"
         ParamLength "0"
         ParamScale "0"
      END DSSUBRECORD
      BEGIN DSSUBRECORD
         Name "m"
         Prompt "n"
         Default "p"
         ParamType "0"
         ParamLength "0"
         ParamScale "0"
      END DSSUBRECORD


I need to print the records starting from Name to ParamScale .Please note there are spaces in front of these lines .

Expected output:
Code:
         Name "a"
         Prompt "b"
         Default "c"
         ParamType "0"
         ParamLength "0"
         ParamScale "0"
         Name "d"
         Prompt "e"
         Default "f"
         ParamType "0"
         ParamLength "0"
         ParamScale "0"
         Name "g"
         Prompt "h"
         Default "i"
         ParamType "0"
         ParamLength "0"
         ParamScale "0"
         Name "j"
         Prompt "k"
         Default "l"
         ParamType "0"
         ParamLength "0"
         ParamScale "0"
         Name "m"
         Prompt "n"
         Default "p"
         ParamType "0"
         ParamLength "0"
         ParamScale "0"

Please help .....

Last edited by Scrutinizer; 06-11-2012 at 02:40 PM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search file for pattern and grab some lines before pattern

I want to search a file for a string and then if the string is found I need the line that the string is on - but also the previous two lines from the file (that the pattern will not be found in) This is on solaris Can you help? (2 Replies)
Discussion started by: frustrated1
2 Replies

2. UNIX for Dummies Questions & Answers

modify a particular pattern starting from second line of the search pattern

Hi, I am new to this forum and i would like to get help in this issue. I have a file 1.txt as shown: apple banana orange apple grapes banana orange grapes orange .... Now i would like to search for pattern say apple or orange and then put a # at the beginning of the pattern... (2 Replies)
Discussion started by: imas
2 Replies

3. UNIX for Dummies Questions & Answers

modify a particular pattern starting from second line of the search pattern

Hi, I think you ppl did not get my question correctly, let me explain I have 1.txt with following entries as shown: 0152364|134444|10.20.30.40|015236433 0233654|122555|10.20.30.50|023365433 ** ** ** In file 2.txt I have the following entries as shown: ... (1 Reply)
Discussion started by: imas
1 Replies

4. Shell Programming and Scripting

search a pattern and if pattern found insert new pattern at the begining

I am trying to do some thing like this .. In a file , if pattern found insert new pattern at the begining of the line containing the pattern. example: in a file I have this. gtrow0unit1/gctunit_crrownorth_stage5_outnet_feedthru_pin if i find feedthru_pin want to insert !! at the... (7 Replies)
Discussion started by: pitagi
7 Replies

5. Shell Programming and Scripting

Print a pattern between the xml tags based on a search pattern

Hi all, I am trying to extract the values ( text between the xml tags) based on the Order Number. here is the sample input <?xml version="1.0" encoding="UTF-8"?> <NJCustomer> <Header> <MessageIdentifier>Y504173382</MessageIdentifier> ... (13 Replies)
Discussion started by: oky
13 Replies

6. Shell Programming and Scripting

Need one liner to search pattern and print everything expect 6 lines from where pattern match made

i need to search for a pattern from a big file and print everything expect the next 6 lines from where the pattern match was made. (8 Replies)
Discussion started by: chidori
8 Replies

7. Shell Programming and Scripting

Search for a pattern in a String file and count the occurance of each pattern

I am trying to search a file for a patterns ERR- in a file and return a count for each of the error reported Input file is a free flowing file without any format example of output ERR-00001=5 .... ERR-01010=10 ..... ERR-99999=10 (4 Replies)
Discussion started by: swayam123
4 Replies

8. Shell Programming and Scripting

How to use sed to search a particular pattern in a file backward after a pattern is matched.?

Hi, I have two files file1.txt and file2.txt. Please see the attachments. In file2.txt (which actually is a diff output between two versions of file1.txt.), I extract the pattern corresponding to 1172c1172. Now ,In file1.txt I have to search for this pattern 1172c1172 and if found, I have to... (9 Replies)
Discussion started by: saurabh kumar
9 Replies

9. Shell Programming and Scripting

Search pattern on logfile and search for day/dates and skip duplicate lines if any

Hi, I've written a script to search for an Oracle ORA- error on a log file, print that line and the .trc file associated with it as well as the dateline of when I assumed the error occured. In most it is the first dateline previous to the error. Unfortunately, this is not a fool proof script.... (2 Replies)
Discussion started by: newbie_01
2 Replies

10. UNIX for Beginners Questions & Answers

Grep/awk using a begin search pattern and end search pattern

I have this fileA TEST FILE ABC this file contains ABC; TEST FILE DGHT this file contains DGHT; TEST FILE 123 this file contains ABC, this file contains DEF, this file contains XYZ, this file contains KLM ; I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies
LDAPPASSWD(1)						      General Commands Manual						     LDAPPASSWD(1)

NAME
ldappasswd - change the password of an LDAP entry SYNOPSIS
ldappasswd [-A] [-a oldPasswd] [-t oldpasswdfile] [-D binddn] [-d debuglevel] [-H ldapuri] [-h ldaphost] [-n] [-p ldapport] [-S] [-s new- Passwd] [-T newpasswdfile] [-v] [-W] [-w passwd] [-y passwdfile] [-O security-properties] [-I] [-Q] [-U authcid] [-R realm] [-x] [-X authzid] [-Y mech] [-Z[Z]] [user] DESCRIPTION
ldappasswd is a tool to set the password of an LDAP user. ldappasswd uses the LDAPv3 Password Modify (RFC 3062) extended operation. ldappasswd sets the password of associated with the user [or an optionally specified user]. If the new password is not specified on the command line and the user doesn't enable prompting, the server will be asked to generate a password for the user. ldappasswd is neither designed nor intended to be a replacement for passwd(1) and should not be installed as such. OPTIONS
-A Prompt for old password. This is used instead of specifying the password on the command line. -a oldPasswd Set the old password to oldPasswd. -t oldPasswdFile Set the old password to the contents of oldPasswdFile. -x Use simple authentication instead of SASL. -D binddn Use the Distinguished Name binddn to bind to the LDAP directory. For SASL binds, the server is expected to ignore this value. -d debuglevel Set the LDAP debugging level to debuglevel. ldappasswd must be compiled with LDAP_DEBUG defined for this option to have any effect. -H ldapuri Specify URI(s) referring to the ldap server(s); only the protocol/host/port fields are allowed; a list of URI, separated by white- space or commas is expected. -h ldaphost Specify an alternate host on which the ldap server is running. Deprecated in favor of -H. -p ldapport Specify an alternate TCP port where the ldap server is listening. Deprecated in favor of -H. -n Do not set password. (Can be useful when used in conjunction with -v or -d) -S Prompt for new password. This is used instead of specifying the password on the command line. -s newPasswd Set the new password to newPasswd. -T newPasswdFile Set the new password to the contents of newPasswdFile. -v Increase the verbosity of output. Can be specified multiple times. -W Prompt for bind password. This is used instead of specifying the password on the command line. -w passwd Use passwd as the password to bind with. -y passwdfile Use complete contents of passwdfile as the password for simple authentication. -O security-properties Specify SASL security properties. -I Enable SASL Interactive mode. Always prompt. Default is to prompt only as needed. -Q Enable SASL Quiet mode. Never prompt. -U authcid Specify the authentication ID for SASL bind. The form of the ID depends on the actual SASL mechanism used. -R realm Specify the realm of authentication ID for SASL bind. The form of the realm depends on the actual SASL mechanism used. -X authzid Specify the requested authorization ID for SASL bind. authzid must be one of the following formats: dn:<distinguished name> or u:<username>. -Y mech Specify the SASL mechanism to be used for authentication. If it's not specified, the program will choose the best mechanism the server knows. -Z[Z] Issue StartTLS (Transport Layer Security) extended operation. If you use -ZZ, the command will require the operation to be success- ful SEE ALSO
ldap_sasl_bind(3), ldap_extended_operation(3), ldap_start_tls_s(3) AUTHOR
The OpenLDAP Project <http://www.openldap.org/> ACKNOWLEDGEMENTS
OpenLDAP Software is developed and maintained by The OpenLDAP Project <http://www.openldap.org/>. OpenLDAP Software is derived from Uni- versity of Michigan LDAP 3.3 Release. OpenLDAP 2.4.28 2011/11/24 LDAPPASSWD(1)
All times are GMT -4. The time now is 09:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy