Sponsored Content
Top Forums Shell Programming and Scripting extract string and sending it into a new file in perl program Post 302422527 by durden_tyler on Tuesday 18th of May 2010 04:13:19 PM
Old 05-18-2010
Code:
$
$
$ cat test.out
[ DEBUG - conn=-1 op=-1 msgId=-1 - libdb: PANIC: fatal region error detected; run recovery
export test: Processed 224000 entries
[ DEBUG - conn=-1 op=-1 msgId=-1 - libdb: PANIC: fatal region error detected; run recovery
export test: Processed 224000 entries
[ DEBUG - conn=-1 op=-1 msgId=-1 - libdb: PANIC: fatal region error detected; run recovery
export test: Processed 224000 entries
[ DEBUG - conn=-1 op=-1 msgId=-1 - libdb: PANIC: fatal region error detected; run recovery
$
$
$ perl -lne 'BEGIN {open(OUT, ">panic.txt")} /PANIC/ && print OUT $_; END{close(OUT)}' test.out
$
$
$ cat panic.txt
[ DEBUG - conn=-1 op=-1 msgId=-1 - libdb: PANIC: fatal region error detected; run recovery
[ DEBUG - conn=-1 op=-1 msgId=-1 - libdb: PANIC: fatal region error detected; run recovery
[ DEBUG - conn=-1 op=-1 msgId=-1 - libdb: PANIC: fatal region error detected; run recovery
[ DEBUG - conn=-1 op=-1 msgId=-1 - libdb: PANIC: fatal region error detected; run recovery
$
$

tyler_durden
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl newbie: how to extract an unknown word from a string

hi, im quite new to perl regexp. i have a problem where i want to extract a word from a given string. but the word is unknown, only fact is that it appears as the second word in the string. Eg. input string(s) : char var1 = 'A'; int var2 = 10; char *ptr; and what i want to do is... (3 Replies)
Discussion started by: wolwy_pete
3 Replies

2. Shell Programming and Scripting

Search for string in a file and extract another string to a variable

Hi, guys. I have one question: I need to search for a string in a file, and then extract another string from the file and assign it to a variable. For example: the contents of the file (group) is below: ... ftp:x:23: mail:x:34 ... testing:x:2001 sales:x:2002 development:x:2003 ...... (6 Replies)
Discussion started by: daikeyang
6 Replies

3. Shell Programming and Scripting

Perl Extract String

Hi, I have a string like "something is good wanted (bla bla)" I need to get the world "wanted" from this string and "assign it to a variable".. but it's not a static word so i want to get that word by searching the pattern as follows <space>desiredword<space>( and i tried to get that... (6 Replies)
Discussion started by: xlynx3
6 Replies

4. Shell Programming and Scripting

Perl and sending file to server

Hi, I am trying to write some test code for bigger project where my perl script will send file over to server. This is the current SERVER and CLIENT code I have so far. When I type "hi" from client I get hello back from server and like wise I send send command I get respond back the problem... (1 Reply)
Discussion started by: Dabheeruz
1 Replies

5. Shell Programming and Scripting

Perl REGEX - How do extract a string in a line?

Hi Guys, In the following line: cn=portal.090710.191533.428571000,cn=groups,dc=mp,dc=rj,dc=gov,dc=br I need to extract this string: portal.090710.191533.428571000 As you can see this string always will be bettween "cn=" and "," strings. Someone know one regular expression to... (4 Replies)
Discussion started by: maverick-ski
4 Replies

6. Shell Programming and Scripting

Sending email and attachment file using Perl

I am trying to send an email body of information and also attachment using perl script, but I am only able to send the body but not an attachment. is there around it without using "use MIME::Lite;" module. $user = "bataf\@xyz.com"; $subjectt = "mail from perl"; open(MAIL, "| mailx -s... (1 Reply)
Discussion started by: bataf
1 Replies

7. Shell Programming and Scripting

Extract string from a file & write to a new file (Perl)

Hi, This is the first time playing around with perl and need some help. Assuming if i have a line of text that looks like this: Date/Time=Nov 18 17:12:11;Device Name=192.168.1.1;Device IP=192.168.1.1;Device Class=IDS;Source IP=155.212.212.111;Source Name=UNKNOWN;Source Port=1679... (3 Replies)
Discussion started by: LuckyGuy
3 Replies

8. Shell Programming and Scripting

Sending zip file as attachments in perl

Hi All, i have a code, where that script is sending mail to the users, but i want to enhance it, i.e i need to add attachment(zip file) to that, i dont want to use MIME:LITE module or any other module, with this simple code, i need to enhance. below is my code my %mail_params = (HTML ... (13 Replies)
Discussion started by: asak
13 Replies

9. Shell Programming and Scripting

Extract a string between 2 ref string from a file

Hi, May i ask if someone share some command for extracting a string between 2 ref string in a txt file My objective: i had a file with multiple lines and wants only to extract the string "watch?v=IbkAXOmEHpY" or "watch?v=<11 random character>", when i used "grep 'watch?=*' i got a results per... (4 Replies)
Discussion started by: jao_madn
4 Replies

10. Shell Programming and Scripting

Extract n-digits from string in perl

Hello, I have a log file with logs such as 01/05/2017 10:23:41 : file.log.38: database error, MODE=SINGLE, LEVEL=critical, STATE: 01170255 (mode main how can i use perl to extract the 8-digit number below from the string 01170255 Thanks (7 Replies)
Discussion started by: james2009
7 Replies
ovdb_recover(8) 					    InterNetNews Documentation						   ovdb_recover(8)

NAME
ovdb_recover - Perform recovery on the ovdb database, if needed SYNOPSYS
ovdb_recover [-f] DESCRIPTION
Attempts to open the ovdb database, and if the database needs recovery, it attempts to perform the recovery. Similar in function to the BerkeleyDB db_recover command. Specify the `-f' option to force a recovery, even if the database appears to not need it. It is not an error to perform a recovery opera- tion on a clean database. However, do not run `ovdb_recover -f' while the database is in use by any other processes. Returns exit status of 0 if the database did not need recovery or if recovery succeeded, and returns exit status 1 if recovery failed. In the latter case, the database may be damaged beyond repair, requiring a rebuild with makehistory(8). This command is normally called automatically by rc.news(8). HISTORY
Written by Heath Kehoe <hakehoe@avalon.net> for InterNetNews. SEE ALSO
ovdb(5), makehistory(8) 3rd Berkeley Distribution INN 2.3 ovdb_recover(8)
All times are GMT -4. The time now is 09:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy