Sponsored Content
Full Discussion: First Occurence
Top Forums UNIX for Advanced & Expert Users First Occurence Post 302094636 by kkm_job on Monday 30th of October 2006 04:28:03 PM
Old 10-30-2006
First Occurence

Hi,
This is the format of the file that i have
StartDate:10/01/06
EndDate :10/02/06

Cno Ccode
1 10
2 11


StartDate:10/03/06
EndDate :10/04/06

Cno Ccode
2 13
4 12


StartDate:10/01/06
EndDate :10/02/06

Cno Ccode
3 10
2 15




I need the first occurence of startdate and end date in a seperate file...
So the new file should have a row with values of
10/01/06,10/02/06


Can some help me writing the script


Thanks
Kiran
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep for certain occurence

I am using grep to pull out info from a file. The line I am searching for begins: START TIME - Tue Sep 11 16:40:00. There are mutiple lines of START TIME. I need the FIRST occurence ONLY. My grep is as follows: start="$( grep 'START TIME' filename | cut -c15-33)" If I echo or cat... (2 Replies)
Discussion started by: app4dxh
2 Replies

2. UNIX for Dummies Questions & Answers

grep the last occurence

is there a grep or awk one-line command to print the line of the last occurence of a string in a file? (3 Replies)
Discussion started by: apalex
3 Replies

3. Shell Programming and Scripting

Extracting the last occurence

Hi All, Is there any awk or unix command that i can make use such that the output will be as desired ? The code will extract the latest pattern starting from the term above the asterix till the end of the input Input: ******** aaa bbb 2007 ******** 123 234 134 ******** xxx yyy 2007... (9 Replies)
Discussion started by: Raynon
9 Replies

4. UNIX for Dummies Questions & Answers

First occurence from grep

Hi , supoose i have a file in which a word is repeated so many times. I just want the firts occurence of that word through grep and it should not go to the next one means get the first occurence and stop there. Suggest me some solutions. Thanks Namish (10 Replies)
Discussion started by: namishtiwari
10 Replies

5. UNIX for Dummies Questions & Answers

Only one particular occurence needs to be substituted !!!

In a file, field separetor in line is irregular number of spaces, so I canot use field in sub function to get my charecter replaced with empty space. I would like to substitute only one perticular charecter with space at perticular posiotn, so I canot use perticular character as that may occur... (6 Replies)
Discussion started by: vaka
6 Replies

6. Shell Programming and Scripting

Change first occurence

I'm not getting the syntax correct to change a line only on the first occurrence: I've tried to change only the first match and I've tried to change the from the second match forward sed 's/<B>PT#/<tr><td class=\"pt1\" width=\"40%\"><B>pt#/1' $file > tmpfile.html sed ... (0 Replies)
Discussion started by: dba_frog
0 Replies

7. UNIX for Dummies Questions & Answers

How to print first occurence

Hi there, how can i print the first pattern occurrence in a .log file? I want to print the filename of the first 17262? I tried but all I can do is print all the lines with the number 17262? I tried using awk and sed but nothing!:wall: I just want filename! Here´s an example: 17259... (3 Replies)
Discussion started by: BMatter
3 Replies

8. Shell Programming and Scripting

Percentage of occurence

Dear all, I have data like below and i need to add coloumn before the COUNT field to see the Percentage out of all COUNT field value for respective raw. ============================================= COUNT CODE sConnType tConnType... (6 Replies)
Discussion started by: Iroshan
6 Replies

9. Shell Programming and Scripting

Print between patterns - first occurence, second occurence etc

I have a file # cat asasas AAAAAA 11 22 33 44 BBBBB NILNILNIL AAAAAA 22 33 44 55 66 77 88 BBBBB NILNILNIL (2 Replies)
Discussion started by: anil510
2 Replies

10. UNIX for Advanced & Expert Users

Get the first occurence between two patterns

I have an output file which gives me the timely status of a server. Sample file: March 11 2014 21:10, 1, 2, 3, 4, 5, 6, 7, 8, 9, x, y, z... 21:05, 1, 2, 3, 4, 5, 6, 7, 8, 9, x, y, z... 21:00, 1, 2, 3, 4,... (3 Replies)
Discussion started by: rpm120
3 Replies
IPSEC_OPENAC(8) 					      System Manager's Manual						   IPSEC_OPENAC(8)

NAME
ipsec openac - Generation of X.509 attribute certificates SYNOPSIS
ipsec openac [ --help ] [ --version ] [ --optionsfrom filename ] [ --quiet ] [ --debug level ] [ --days days ] [ --hours hours ] [ --startdate YYYYMMDDHHMMSSZ ] [ --stopdate YYYYMMDDHHMMSSZ ] --cert certfile --key keyfile [ --password password ] --usercert certfile --groups attr1,attr2,... --out filename DESCRIPTION
openac is intended to be used by an Authorization Authority (AA) to generate and sign X.509 attribute certificates. Currently only the inclusion of one ore several group attributes is supported. An attribute certificate is linked to a holder by including the issuer and serial number of the holder's X.509 certificate. OPTIONS
--help display the usage message. --version display the version of openac. --optionsfrom filename adds the contents of the file to the argument list. If filename is a relative path then the file is searched in the directory /etc/openac. --quiet By default openac logs all control output both to syslog and stderr. With the --quiet option no output is written to stderr. --days days Validity of the X.509 attribute certificate in days. If neiter the --days nor the --hours option is specified then a default valid- ity interval of 1 day is assumed. The --days option can be combined with the --hours option. --hours hours Validity of the X.509 attribute certificate in hours. If neiter the --hours nor the --days option is specified then a default valid- ity interval of 24 hours is assumed. The --hours option can be combined with the --days option. --startdate YYYYMMDDHHMMSSZ defines the notBefore date when the X.509 attribute certificate becomes valid. The date YYYYMMDDHHMMSS must be specified in UTC (Zulu time). If the --startdate option is not specified then the current date is taken as a default. --stopdate YYYYMMDDHHMMSSZ defines the notAfter date when the X.509 attribute certificate will expire. The date YYYYMMDDHHMMSS must be specified in UTC (Zulu time). If the --stopdate option is not specified then the default notAfter value is computed by adding the validity interval speci- fied by the --days and/or --days options to the notBefore date. --cert certfile specifies the file containing the X.509 certificate of the Authorization Authority. The certificate is stored either in PEM or DER format. --key keyfile specifies the encrypted file containing the private RSA key of the Authoritzation Authority. The private key is stored in PKCS#1 format. --password password specifies the password with which the private RSA keyfile defined by the --key option has been protected. If the option is missing then the password is prompted for on the command line. --usercert certfile specifies file containing the X.509 certificate of the user to which the generated attribute certificate will apply. The certificate file is stored either in PEM or DER format. --groups attr1,attr2 specifies a comma-separated list of group attributes that will go into the X.509 attribute certificate. --out filename specifies the file where the generated X.509 attribute certificate will be stored to. Debugging openac produces a prodigious amount of debugging information. To do so, it must be compiled with -DDEBUG. There are several classes of debugging output, and openac may be directed to produce a selection of them. All lines of debugging output are prefixed with ``| '' to distinguish them from error messages. When openac is invoked, it may be given arguments to specify which classes to output. The current options are: --debug level sets the debug level to 0 (none), 1 (normal), 2 (more), 3 (raw), and 4 (private), the default level being 1. EXIT STATUS
The execution of openac terminates with one of the following two exit codes: 0 means that the attribute certificate was successfully generated and stored. 1 means that something went wrong. FILES
/etc/openac/serial serial number of latest attribute certificate SEE ALSO
The X.509 attribute certificates generated with openac can be used to enforce group policies defined by ipsec.conf(5). Use ipsec_auto(8) to load and list X.509 attribute certificates. For more information on X.509 attribute certificates, refer to the following IETF RFC: RFC 3281 An Internet Attribute Certificate Profile for Authorization HISTORY
The openac program was originally written by Ariane Seiler and Ueli Galizzi. The software was recoded by Andreas Steffen using strongSwan's X.509 library and the ASN.1 code synthesis functions written by Christoph Gysin and Christoph Zwahlen. All authors were with the Zurich University of Applied Sciences in Winterthur, Switzerland. BUGS
Bugs should be reported to the <users@lists.strongswan.org> mailing list. 22 September 2007 IPSEC_OPENAC(8)
All times are GMT -4. The time now is 11:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy