Sponsored Content
Top Forums Shell Programming and Scripting To extract the required lines from a file Post 302280133 by zaxxon on Monday 26th of January 2009 05:03:35 AM
Old 01-26-2009
Code:
sed '/---BEGIN CERT-----/,/---END CERT -----/!d' infile > newfile

You can find such stuff searching the web by looking for "sed ranges".

Last edited by zaxxon; 01-26-2009 at 06:17 AM.. Reason: added the redirection, just in case...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help required regarding Extracting lines from a file

I have a file containing the following contents All of us, including Zippy, our dog All of us, including Zippy and Zippy All of us, including Zippy and Zippy and Zelda Testing All of us Zippy Now, i wanna grep and get the lines which has only one occurance of word Zippy and starting with... (1 Reply)
Discussion started by: google_ever
1 Replies

2. Shell Programming and Scripting

How to extract the required lines?

Hi Techies, I got struck in middle of a problem. I have the following data whose format is: a 1 a 2 a 3 a 4 b 1 b 2 b 3 b 4 c 1 c 2 c 3 c 4 I wanted the output from this to be: a 3 a 4 (11 Replies)
Discussion started by: 14341
11 Replies

3. UNIX for Dummies Questions & Answers

How get only required lines & delete the rest of the lines in file

Hiiii I have a file which contains huge data as a.dat: PDE 1990 1 9 18 51 28.90 24.7500 95.2800 118.0 6.1 0.0 BURMA event name: 010990D time shift: 7.3000 half duration: 5.0000 latitude: 24.4200 longitude: 94.9500 depth: 129.6000 Mrr: ... (7 Replies)
Discussion started by: reva
7 Replies

4. Shell Programming and Scripting

Script required to extract a specific snippet from the entire file.

Hi, I have a file with the following structure. XXXXX........... YYYYY........... ................. .................. ZZZZZZ...... qwerty_start.............. .................. ................. .................. querty_end................ .............................. (1 Reply)
Discussion started by: abinash
1 Replies

5. Shell Programming and Scripting

Extract some lines from one file and add those lines to current file

hi, i have two files. file1.sh echo "unix" echo "linux" file2.sh echo "unix linux forums" now the output i need is $./file2.sh unix linux forums (3 Replies)
Discussion started by: snreddy_gopu
3 Replies

6. Shell Programming and Scripting

Extract particular lines from a file

Hi all, I have a file with many records with information as given below ID A16L2_HUMAN Reviewed; 619 AA. AC Q8NAA4; A5PL30; B2RPK5; Q658V4; Q6PID3; Q8NBG0; DT 20-MAY-2008, integrated into UniProtKB/Swiss-Prot. DT 20-MAY-2008, sequence version 2. DT ... (1 Reply)
Discussion started by: kaav06
1 Replies

7. Shell Programming and Scripting

How to extract certain lines from a file?

Hi guys I have a several thousands line file in the following format: n817 -------------------------------------------------- n842 -------------------------------------------------- n877 -------------------------------------------------- n513 /bb/data/rmt2db.lrl:JBSKDB 31915 75... (4 Replies)
Discussion started by: aoussenko
4 Replies

8. Shell Programming and Scripting

Help required deleting specific lines from file

Hi, I have a file with 20 columns of data and hundreds of lines of the same format. Here is an example line. The data repeats underneath with the same format. 15 1 4 GLY - 1 65 LYSH 23 N - 24 H - 634 O 0.188 157.552 487 48.70I have been sorting this data by hand but I was wondering if I... (3 Replies)
Discussion started by: livbaddeley
3 Replies

9. Shell Programming and Scripting

Required 3 lines above the file and below file when string matches

i had requirement like i need to get "error" line of above 3 and below 3 from a file .I tried with the below script.But it's not working. y='grep -n -i error /home/file.txt|cut -c1' echo $y head -$y /home/file.txt| tail -3 >tmp.txt tail -$y /home/file.txt head -3 >>tmp.txt (4 Replies)
Discussion started by: bhas85
4 Replies

10. UNIX for Beginners Questions & Answers

How to search a text in file and retrieve required lines following it with UNIX command?

I have requirement to search for a text in the file and retrieve required lines that is user defined with unix command. Eg: Find the text UNIX in the below file and need to return Test 8 & Test 9 Test 1 Test 2 Test 3 Test 4 UNIX Test 5 Test 6 Test 7 Test 8 Test 9 Result can... (8 Replies)
Discussion started by: Arunkumarsak4
8 Replies
STAP-AUTHORIZE-SIGNING-CERT(8)				      System Manager's Manual				    STAP-AUTHORIZE-SIGNING-CERT(8)

NAME
stap-authorize-signing-cert - systemtap signing authorization utility SYNOPSIS
stap-authorize-signing-cert CERTFILE [ DIRNAME ] DESCRIPTION
The staprun program will load modules for members of the group stapusr if they are signed by a trusted signer. A trusted signer is usually a systemtap compile server which signs modules when the client (stap-client) specifies the --unprivileged option. The trustworthiness of a given signer can not be determined automatically without a trusted certificate authority issuing systemtap signing certificates. This is not practical in everyday use and so, staprun must authenticate servers against its own database of trusted signers. In this context, establishing a given signer as trusted means adding that signer's certificate to staprun's database of trusted signers. The stap-authorize-signing-cert program adds the given signing certificate to the given certificate database, making that signer a trusted server for staprun when using that database. ARGUMENTS
The stap-authorize-signing-cert program accepts two arguments: CERTFILE This is the name of the file containing the certificate of the new trusted signer. For systemtap compile servers, this is the file named stap.cert which can be found in the server's certificate database. On the server host, for servers started by the stap-server service, this database can be found in /var/lib/stap-server/.systemtap/ssl/server/. For servers run by other non-root users, this database can be found in $HOME/.systemtap/ssl/server/. For root users (EUID=0), it can be found in /etc/systemtap/ssl/server. DIRNAME This optional argument is the name of the directory containing the certificate database to which the certificate is to be added. If not specified, the default is /etc/systemtap/staprun/. That is, the default result is that all users on the local host will trust this signer. Note that this default directory is only writable by root. SAFETY AND SECURITY
Systemtap is an administrative tool. It exposes kernel internal data structures and potentially private user information. See the stap(1) manual page for additional information on safety and security. Systemtap uses Network Security Services (NSS) for module signing and verification. The NSS tool certutil is used for the generation of certificates. The related certificate databases must be protected in order to maintain the security of the system. Use of the utilities provided will help to ensure that the proper protection is maintained. staprun will check for proper access permissions before making use of any certificate database. FILES
/etc/systemtap/staprun/ staprun's trusted signer certificate database. /var/lib/stap-server/.systemtap/ssl/server/stap.cert Signing certificate for servers started by the stap-server service. SEE ALSO
stap(1), staprun(8), stap-server(8), stap-client(8), NSS, certutil BUGS
Use the Bugzilla link of the project web page or our mailing list. http://sources.redhat.com/systemtap/, <systemtap@sources.redhat.com>. Red Hat 2010-07-05 STAP-AUTHORIZE-SIGNING-CERT(8)
All times are GMT -4. The time now is 08:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy