Sponsored Content
Top Forums Shell Programming and Scripting awk pattern search and put in a file Post 302381096 by ahmad.diab on Thursday 17th of December 2009 07:09:47 AM
Old 12-17-2009
what is the o/p of cat file?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

search a word in a xml file and print the out put

hi , i m having a html file and this file looks like this <ssl> <name>PIA</name> <enabled>true</enabled> <listen-port>39370</listen-port> </ssl> <log> <name>PIA</name> </log> <execute-queue> <name>weblogic.kernel.Default</name> ... (7 Replies)
Discussion started by: becksram123
7 Replies

2. Shell Programming and Scripting

Awk search for string pattern in delimited file

I've got a semicolon delimited file. I would like to search for fields that match a pattern, and not hardcoded eg "mth". *th=something If the delimited field fulfills this condition, eg. mth=value I would like to print out both key and value for some number comparison. eg. if value > "12"... (5 Replies)
Discussion started by: alienated
5 Replies

3. Shell Programming and Scripting

Awk/Sed: Search Pattern from file and Print

Hi, I want to search for patterns (from a file) in a file and print the line matching the patterns and the line before it. I have to search for 100s of patterns from a file. Any help with AWK or Sed. Thanks! (2 Replies)
Discussion started by: saint2006
2 Replies

4. Shell Programming and Scripting

Help to search multiple pattern in file with grep/sed/awk

Hello All, I have a file which is having below type of data, Jul 19 2011 | 123456 Jul 19 2011 | 123456 Jul 20 2011 | 123456 Jul 20 2011 | 123456 Here I wanted to grep for date pattern as below, so that it should only grep "Jul 20" OR "Jul ... (9 Replies)
Discussion started by: gr8_usk
9 Replies

5. UNIX for Advanced & Expert Users

use of variables in awk to search for pattern from a file

Hi, I need to extract all the content between two strings stored in two variables "startstring" and "endstring" startstring=hello enstring=world #notworking awk '/$startstring/, $NF ~ /$endstring/ ' file > file2 The above code is not working with variables. It works when actual string... (2 Replies)
Discussion started by: jeanjkj
2 Replies

6. Programming

search file and put into struct

hi everybody, I need some help with some programming. I need to write a file that can search in a text file and read the whole line into a struct. the struct = struct Transistor { char chType; char chFabrikant; float fPrijs; enum Transistor_Behuizing { empty,TO18, TO39,... (8 Replies)
Discussion started by: metal005
8 Replies

7. Shell Programming and Scripting

awk get search pattern from a file.

Here Is a problem I am facing with awk. Query --> I want to search for a string in a file and print next 15 lines below the matched string. 1.We do not have GNU grep so cannot use grep -A or grep -B commands. 2. Instead of passing the search pattern as a string to awk. I want the awk to... (4 Replies)
Discussion started by: togotutor
4 Replies

8. Shell Programming and Scripting

Awk to match a pattern and perform a search after the first pattern

Hello Guyz I have been following this forum for a while and the solutions provided are super useful. I currently have a scenario where i need to search for a pattern and start searching by keeping the first pattern as a baseline ABC DEF LMN EFG HIJ LMN OPQ In the above text i need to... (8 Replies)
Discussion started by: RickCharles
8 Replies

9. 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

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
IPSEC_SPIGRP(8) 						Executable programs						   IPSEC_SPIGRP(8)

NAME
ipsec_spigrp - group/ungroup IPSEC Security Associations SYNOPSIS
ipsec spigrp ipsecspigrp [--label label] af1dst1spi1proto1 [af2dst2spi2proto2 [af3dst3spi3proto3 [af4dst4spi4proto4]]] ipsecspigrp [--label label] --said SA1 [SA2 [SA3 [SA4]]] ipsecspigrp --help ipsecspigrp --version OBSOLETE
Note that spi is only supported on the classic KLIPS stack. It is not supported on any other stack and will be completely removed in future versions. A replacement command still needs to be designed DESCRIPTION
Spigrp groups IPSEC Security Associations (SAs) together or ungroups previously grouped SAs. An entry in the IPSEC extended routing table can only point (via a destination address, a Security Parameters Index (SPI) and a protocol identifier) to one SA. If more than one transform must be applied to a given type of packet, this can be accomplished by setting up several SAs with the same destination address but potentially different SPIs and protocols, and grouping them with spigrp. The SAs to be grouped, specified by destination address (DNS name lookup, IPv4 dotted quad or IPv6 coloned hex), SPI ('0x'-prefixed hexadecimal number) and protocol ("ah", "esp", "comp" or "tun"), are listed from the inside transform to the outside; in other words, the transforms are applied in the order of the command line and removed in the reverse order. The resulting SA group is referred to by its first SA (by af1, dst1, spi1 and proto1). The --said option indicates that the SA IDs are to be specified as one argument each, in the format <proto><af><spi>@<dest>. The SA IDs must all be specified as separate parameters without the --said option or all as monolithic parameters after the --said option. The SAs must already exist and must not already be part of a group. If spigrp is invoked with only one SA specification, it ungroups the previously-grouped set of SAs containing the SA specified. The --label option identifies all responses from that command invocation with a user-supplied label, provided as an argument to the label option. This can be helpful for debugging one invocation of the command out of a large number. The command form with no additional arguments lists the contents of /proc/net/ipsec_spigrp. The format of /proc/net/ipsec_spigrp is discussed in ipsec_spigrp(5). EXAMPLES
ipsec spigrp inet gw2 0x113 tun inet gw2 0x115 esp inet gw2 0x116 ah groups 3 SAs together, all destined for gw2, but with an IPv4-in-IPv4 tunnel SA applied first with SPI 0x113, then an ESP header to encrypt the packet with SPI 0x115, and finally an AH header to authenticate the packet with SPI 0x116. ipsec spigrp --said tun.113@gw2 esp.115@gw2 ah.116@gw2 groups 3 SAs together, all destined for gw2, but with an IPv4-in-IPv4 tunnel SA applied first with SPI 0x113, then an ESP header to encrypt the packet with SPI 0x115, and finally an AH header to authenticate the packet with SPI 0x116. ipsec spigrp --said tun:233@3049:1::1 esp:235@3049:1::1 ah:236@3049:1::1 groups 3 SAs together, all destined for 3049:1::1, but with an IPv6-in-IPv6 tunnel SA applied first with SPI 0x233, then an ESP header to encrypt the packet with SPI 0x235, and finally an AH header to authenticate the packet with SPI 0x236. ipsec spigrp inet6 3049:1::1 0x233 tun inet6 3049:1::1 0x235 esp inet6 3049:1::1 0x236 ah groups 3 SAs together, all destined for 3049:1::1, but with an IPv6-in-IPv6 tunnel SA applied first with SPI 0x233, then an ESP header to encrypt the packet with SPI 0x235, and finally an AH header to authenticate the packet with SPI 0x236. FILES
/proc/net/ipsec_spigrp, /usr/local/bin/ipsec SEE ALSO
ipsec(8), ipsec_manual(8), ipsec_tncfg(8), ipsec_eroute(8), ipsec_spi(8), ipsec_klipsdebug(8), ipsec_spigrp(5) HISTORY
Written for the Linux FreeS/WAN project <http://www.freeswan.org/> by Richard Guy Briggs. BUGS
Yes, it really is limited to a maximum of four SAs, although admittedly it's hard to see why you would need more. AUTHOR
Paul Wouters placeholder to suppress warning libreswan 12/16/2012 IPSEC_SPIGRP(8)
All times are GMT -4. The time now is 04:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy