Sponsored Content
Top Forums Shell Programming and Scripting Grep between 2 patterns in a line Post 302425324 by naveen@ on Thursday 27th of May 2010 03:42:25 PM
Old 05-27-2010
Done.. Here is what i Got
Code:
[naveen]: head f
     18277 ABC.hyuns.heksd.ut.mestyue_i.mestnem_i.etl1soo__GHytnem__7_0_etl1_mijyt_m_ps_4_ ABC.hyuns.heksd.ut.mestyue_i.mestnem_i.etl1soo__GHytnem__7_0_LKH_real_4_ M THTDTNH0weght +
     18278 ABC.hyuns.heksd.ut.mestyue_i.mestnem_i.etl1soo__GHytnem__7_0_etl1_mijyt_m_ps_5_ ABC.hyuns.heksd.ut.mestyue_i.n_2837 M THTDTNH0weght +
     18279 ABC.hyuns.heksd.ut.mestyue_i.mestnem_i.etl1soo__GHytnem__7_0_etl1_mijyt_m_ps_6_ ABC.hyuns.heksd.ut.mestyue_i.mestnem_i.etl1soo__GHytnem__7_0_LKH_real_6_ M THTDTNH0weght +
     18280 ABC.hyuns.heksd.ut.mestyue_i.mestnem_i.etl1soo__GHytnem__7_0_etl1_mijyt_m_ps_7_ ABC.hyuns.heksd.ut.mestyue_i.mestnem_i.etl1soo__GHytnem__7_0_LKH_real_7_ M THTDTNH0weght +
     18281 ABC.hyuns.heksd.ut.mestyue_i.mestnem_i.etl1soo__PHTem__2_0_etl1_mijyt_m_ps_2_ ABC.hyuns.heksd.ut.mestyue_i.mestnem_i.etl1soo__PHTem__2_0_LKH_real_2_ M THTDTNH0weght +
     18282 ABC.hyuns.heksd.ut.mestyue_i.mestnem_i.etl1soo__PHTem__2_0_etl1_mijyt_m_ps_0_ ABC.hyuns.heksd.ut.mestyue_i.mestnem_i.etl1soo__PHTem__2_0_LKH_real_0_ M THTDTNH0weght +
     18283 ABC.hyuns.heksd.ut.mestyue_i.mestnem_i.etl1soo__PHTem__2_0_etl1_mijyt_m_ps_1_ ABC.hyuns.heksd.ut.mestyue_i.mestnem_i.etl1soo__PHTem__2_0_LKH_real_1_ M THTDTNH0weght +
     18284 ABC.hyuns.heksd.ut.mestyue_i.mestnem_i.etl1soo__OpCodeRWVec2__31_0_etl1_mijyt_m_ps_29_ ABC.hyuns.heksd.ut.mestyue_i.mestnem_i.etl1soo__OpCodeRWVec2__31_0_LKH_real_29_ M THTDTNH0weght +
     18285 ABC.UCTSC.aghsty_4__teluths_0_ ABC.n_1452 M hGfD1TBCLVT +
     18288 "ABC.ABC__889.hukas_0.M675.Xcrtz_0.\JuRl1rtz__ABC_TagOp_TA0_rtz[0] .M895" "ABC.ABC__889.hukas_0.M675.Xcrtz_0.\JuRl1rtz__ABC_TagOp_TA0_rtz[0] .hu23019" LKHX JUHFD4TBC -

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep multiple patterns

Hi, Can we grep multiple patterns in UNIX. for example: cat /x/y/oratab | grep -i "pattern1|pattern2" .... etc I require the syntax for multiple patterns. | is not working as I explained in example. Malay (4 Replies)
Discussion started by: malaymaru
4 Replies

2. Shell Programming and Scripting

grep patterns - File

Hi I have 3 patterns for example to be searched. These three patterns are available in file1. The patterns to be searched are in file2. I want to search the pattern of file1 to file2. Can any one help with example? Regards Dhana (1 Reply)
Discussion started by: dhanamurthy
1 Replies

3. Shell Programming and Scripting

Grep All lines between 2 different patterns

I need a simple script to get all lines between 2 Patterns, e.g. ............. ............. 114456723: testing Script Alpha Beta 114459234: testing Done ............. ............. It should give all the lines in between 114456723 and 114459234, including these as well. Any... (2 Replies)
Discussion started by: gurpreet470
2 Replies

4. Shell Programming and Scripting

grep for multiple patterns

I have a file with many rows. I want to grep for multiple patterns from the file. For eg: XX=123|YY=222|ZZ=566 AA=123|EE=222|GG=566 FF=123|RR=222|GG=566 DD=123|RR=222|GG=566 I want the lines which has both XX and ZZ. I know I can get it like this. grep XX file | grep YY But... (10 Replies)
Discussion started by: tene
10 Replies

5. Shell Programming and Scripting

grep value between two patterns

Hi All, I've been trying solve this with a simple command but not having much luck. I have a file like this: Line 1: random_description 123/alert/high random_description2 356/alert/slow Line 2: random_description3 654/alert/medium Line 3: random_description4 234/alert/critical I'm... (7 Replies)
Discussion started by: joe19
7 Replies

6. UNIX for Dummies Questions & Answers

Grep - various patterns

I have a file with the following text: grep \$ grep \\$ grep \\\$ grep '\$' grep '\'$' grep \\ grep \\\\ grep "\$" grep '"$' grep "$" When I perform these same commands on this file, the result are never what I would expect them to be. Could someone please comment on the results and... (3 Replies)
Discussion started by: uran101
3 Replies

7. Shell Programming and Scripting

comment a line of the patterns is a the beginning of the line

I need to comment the lines starting with pattern "exclude" or "exclude=". If the work exclude comes at any other part, ignore it. Also, ignore, excludes, excluded etc. Ie only comment the line starting with exclude. File contents. exclude exclude= hi I am excluded excludes excludes= ... (9 Replies)
Discussion started by: anil510
9 Replies

8. Shell Programming and Scripting

Grep patterns

Hi Experts, I have a log file like this.I need to filter the Index name and elapsed time(only created ). 06:36:39 SQL> create index XYZ_F75 on XYZ 06:36:39 2 ("GRP_ID", "_ID") parallel 64 nologging 06:36:39 3 tablespace XARGS_IDX 06:36:39 4 ; Index created. Elapsed:... (2 Replies)
Discussion started by: navsan420
2 Replies

9. Shell Programming and Scripting

Find matched patterns and print them with other patterns not the whole line

Hi, I am trying to extract some patterns from a line. The input file is space delimited and i could not use column to get value after "IN" or "OUT" patterns as there could be multiple white spaces before the next digits that i need to print in the output file . I need to print 3 patterns in a... (3 Replies)
Discussion started by: redse171
3 Replies

10. UNIX for Beginners Questions & Answers

Grep multiple patterns(file) and replace whole line

I am able to grep multiple patterns which stored in a files. However, how could we replace the whole line with either the pattern or new string? For example: pattern_file: *Info in the () is not part of the pattern file. They are the intended name to replace the whole line after the pattern... (5 Replies)
Discussion started by: wxboo
5 Replies
kclient(1M)						  System Administration Commands					       kclient(1M)

NAME
kclient - set up a machine as a Kerberos client SYNOPSIS
/usr/sbin/kclient [-n] [-R realm] [-k kdc] [-a adminuser] [-c filepath] [-d dnsarg] [-f fqdn_list] [-p profile] DESCRIPTION
You can use the kclient utility to: o Configure a machine as a Kerberos client for a specified realm and for KDC by setting up krb5.conf(4). o Add the Kerberos host principal to the local host's keytab file (/etc/krb5/krb5.keytab). o Optionally set up the machine to do kerberized NFS. o Optionally bring over a master krb5.conf copy from a specified pathname. o Optionally setup a machine to do server and/or host/domain name-to-realm mapping lookups by means of DNS. The kclient utility needs to be run on the client machine with root permission and can be run either interactively or non-interactively. In the non-interactive mode, the user feeds in the required inputs by means of a profile, command-line options, or a combination of profile and command-line options. The user is prompted for "required" parameter values (realm, kdc, and adminuser), if found missing in the non- interactive run. The interactive mode is invoked when the utility is run without any command-line arguments. Both the interactive and non-interactive forms of kclient always add the host/fqdn entry to the local host's keytab file. They also require the user to enter the password for the administrative user requested, to obtain the Kerberos Ticket Granting Ticket (TGT) for adminuser. The host/fqdn, nfs/fqdn, and root/fqdn principals are added to the KDC database (if not already present) before their addition to the local host's keytab. The kclient utility assumes that the local host has been setup for DNS and requires the presence of a valid resolv.conf(4). Also, kclient can fail if the localhost time is not synchronized with that of the KDC. For Kerberos to function the localhost time must be within five minutes of that of the KDC. It is advised that both systems run some form of time synchronization protocol, such as the Network Time Proto- col (NTP). See xntpd(1M). OPTIONS
The non-interactive mode supports the following options: -n Set up the machine for kerberized NFS. This involves making changes to nfssec.conf(4) and addition of the nfs/fqdn and root/fqdn entries to the local host's keytab file. -R [ realm] Specifies the Kerberos realm. -k [ kdc] Specifies the machine to be used as the Kerberos Key Distribution Center (KDC). -a [ adminuser ] Specifies the Kerberos administrative user. -c [ filepath ] Specifies the pathname to the krb5.conf(4) master file, to be copied over to the local host. The path specified normally points to a master copy on a remote host and brought over to the local host by means of NFS. -d [ dnsarg] Specifies the DNS lookup option to be used and specified in the krb5.conf(4) file. Valid dnsarg entries are: none, dns_lookup_kdc, dns_lookup_realm and dns_fallback. Any other entry is considered invalid. The latter three dnsarg values assume the same meaning as those described in krb5.conf. dns_lookup_kdc implies DNS lookups for the KDC and the other servers. dns_lookup_realm is for host/domain name-to-realm mapping by means of DNS. dns_fallback is a superset and does DNS lookups for both the servers and the host/domain name- to-realm mapping. A lookup option of none specifies that DNS is not be used for any kind of mapping lookup. -f [ fqdn_list] This option creates a service principal entry (host/nfs/root) associated with each of the listed fqdn's, if required, and subsequently adds the entries to the local host's keytab. fqdn_list is a comma-separated list of one or more fully qualified DNS domain names. This option is especially useful in Kerberos realms having systems offering kerberized services, but situated in multiple different DNS domains. -p [ profile] Specifies the profile to be used to enable the reading in of the values of all the parameters required for setup of the machine as a Kerberos client. The profile should have entries in the format: PARAM <value> Valid PARAM entries are: REALM, KDC, ADMIN, FILEPATH, NFS, DNSLOOKUP, and FQDN. These profile entries correspond to the -R [realm], -k [kdc], -a [adminuser], -c [filepath], -n, -d [dnsarg], and -f [fqdn_list] command-line options, respectively. Any other PARAM entry is considered invalid and is ignored. The NFS profile entry can have a value of 0 (do nothing) or 1 (operation is requested). Any other value is considered invalid and is ignored. Keep in mind that the command line options override the PARAM values listed in the profile. EXAMPLES
Example 1: Setting Up a Kerberos Client Using Command-Line Options To setup a Kerberos client using the clntconfig/admin administrative principal for realm 'ABC.COM', kdc `example1.com' and that also does kerberized NFS, enter: # /usr/sbin/kclient -n -R ABC.COM -k example1.com -a clntconfig Alternatively, to set up a Kerberos client using the clntconfig/admin administrative principal for the realm `EAST.ABC.COM', kdc `exam- ple2.east.abc.com' and that also needs service principal(s) created and/or added to the local keytab for multiple DNS domains, enter: # /usr/sbin/kclient -n -R EAST.ABC.COM -k example2.east.abc.com -f west.abc.com,central.abc.com -a clntconfig Note that the krb5 administrative principal used by the administrator needs to have only add, inquire, change-pwd and modify privileges (for the principals in the KDC database) in order for the kclient utility to run. A sample kadm5.acl(4) entry is: clntconfig/admin@ABC.COM acmi Example 2: Setting Up a Kerberos Client Using the Profile Option To setup a Kerberos client using the clntconfig/admin administrative principal for realm `ABC.COM', kdc `example1.com' and that also copies over the master krb5.conf from a specified location, enter: # /usr/sbin/kclient -p /net/example1.com/export/profile.krb5 The contents of profile.krb5: REALM ABC.COM KDC example1 ADMIN clntconfig FILEPATH /net/example1.com/export/krb5.conf NFS 0 DNSLOOKUP none FILES
/etc/krb5/kadm5.acl Kerberos access control list (ACL) file. /etc/krb5/krb5.conf Default location for the local host's configuration file. /etc/krb5/krb5.keytab Default location for the local host's keytab file. /etc/nfssec.conf File listing NFS security modes. /etc/resolv.conf DNS resolver configuration file. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWkdcu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
xntpd(1M), kadm5.acl(4), krb5.conf(4), nfssec.conf(4), resolv.conf(4), attributes(5) NOTES
fqdn stands for the Fully Qualified Domain Name of the local host. The kclient utility saves copies of both the krb5.conf(4) and nfssec.conf(4) files to files with corresponding names and .sav extensions. The optional copy of the krb5.conf(4) master file is neither encrypted nor integrity-protected and it takes place over regular NFS. SunOS 5.10 20 Aug 2004 kclient(1M)
All times are GMT -4. The time now is 10:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy