Sponsored Content
Full Discussion: SOS whit SED
Top Forums Shell Programming and Scripting SOS whit SED Post 302369107 by OPTIMUS_prime on Friday 6th of November 2009 01:01:53 PM
Old 11-06-2009
I couldn't understand your second post. Here is your original post, translated into English:

Greetings,

I need to use SED to create a tool to make my job easier. The objective is to filter a log to show me only those entries that contain a certain string. The format of each entry is as follows:

a) an entry may contain several lines
b) they always begin with a date

Before now I've been able to use SED to insert a blank line between entries: cat registro.log | sed '/^2009-11-06/{x;p;x;}' (I replace the date with a variable obtained with the date command)

With this I've been able to insert a blank line before each log entry so that there is now a way to know when each log entry begins and ends, but now I need to show only those entries that contain a certain string. Can someone help me? Thank you very much.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

(SOS) Please help !

Does anybody can help me with the definition of "terminal" DTE and DCE in context to Unix ?. This has something to do with devices in Unix. I need it asap. Thank you very much !:confused: (1 Reply)
Discussion started by: aqua_jan
1 Replies

2. UNIX for Dummies Questions & Answers

[sos]How to resure my system.

Yesterday,I have a unnormal shutdown of my SCO Unix system,when I boot again,There are lots of Errors (e.g policy manager error, ifor_pmd error etc.),Most seriously,I can use my "CC" compiler: when I compile my *.c files. Who Can Help Me ! Please Don't spare your instructions! Thanks a... (5 Replies)
Discussion started by: dingxf
5 Replies

3. UNIX for Dummies Questions & Answers

compress and descompress file whit pack

hi i dont can traspassing file from unix sco compress whit pack or compress i dont can descompress whit other program... how i can do descompress that file in windows me.??? thank very much... pd:sorry my inglish (6 Replies)
Discussion started by: jtapia
6 Replies

4. Solaris

connect whit Telnet without password

It's possible to connect whit Telnet (or rlogin) whithout password??? I must write a script (this script run on a windows machine), then after the connection on Unix machine, run a perl script and exit. I can know if an host can be consedered "Trusted" like SSH protocol? Thanks! (2 Replies)
Discussion started by: raffyTxT
2 Replies

5. Shell Programming and Scripting

Sos Sos

INPUT---> USER | User1 | DisplayName1 | HomeTown1 | 987654321 | 27-07-1991 | M i want to separate out all the fields of the file which has the format specified above , with the use of awk. I was writing that to the mysql by batch-file. But now there is problem , in databse i have defined the... (2 Replies)
Discussion started by: yogesh_powar
2 Replies

6. Shell Programming and Scripting

Sos

Dear "expert", I need to know the command syntax to get the last field of the line below using shell or awk. MD5... (4 Replies)
Discussion started by: Lee Soon Yau
4 Replies

7. Shell Programming and Scripting

Whats the problem whit my script???

I want to take the even-numbered lines from a file and put them in a separate file and the same thing with the odd-numbered lines. #!/bin/bash file=$1 awk ' { if ( NR % 2 == 0) { (( getline < "$file" ) > "even.txt" )} else { (( getline < "$file" ) > "odd.txt" )} } ' $file (4 Replies)
Discussion started by: cristi2008
4 Replies

8. Solaris

sun connect :SOS

hi all, does someone have any information about "sun connect" (like documentation , web site , forums , explanations .....) ? because i will need this software in my job & i don't know how to use it :o (4 Replies)
Discussion started by: lid-j-one
4 Replies

9. Shell Programming and Scripting

bc, negative values and "total" (whit swapped -)

Hi All, I need to sum numbers, in bash, input is this: 10.00 12.33 14.99 134.00 1211.09 130.01- <--- it is negative, but "-" is at the end.. 901.99 10.34- <--- another negative number... bc -l is giving me error so only solution to my problem would be to swap - to the... (3 Replies)
Discussion started by: columb
3 Replies

10. HP-UX

sos about swpackage AND swinstall

hi all, I just want to make a depot package.All steps: 1. make a psf file # PSF which define the myutil product depot layout_version 1.0 tag ddmi_linux_installer title ddmi_linux_installer # Product definition vendor tag HP title Hewlett-Packard Company product tag... (0 Replies)
Discussion started by: lb1111830
0 Replies
logadm.conf(4)                                                     File Formats                                                     logadm.conf(4)

NAME
logadm.conf - configuration file for logadm command SYNOPSIS
/etc/logadm.conf DESCRIPTION
/etc/logadm.conf is the default configuration file for the log management tool logadm(1M). Comments are allowed using the pound character (#) and extend to the end of line. Each non-comment line has the form: logname options where logname is the name of the entry and options are the default command line options for the logadm command. The name of the entry may be the same as the name of the log file, or a log file name may be given in the options section of the entry. Long lines may be folded using a backslash followed by a newline to continue an entry on the next line. Single or double quotes may be used to protect spaces or alternate-style quotes in strings. The preferred method for changing /etc/logadm.conf is to use the -V, -w, and -r options to the logadm(1M) command, which allow you to lookup an entry, write an entry, or remove an entry from /etc/logadm.conf. A full description of how and when /etc/logadm.conf is used and sample entries are found in logadm(1M). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsr | +-----------------------------+-----------------------------+ SEE ALSO
logadm(1M), attributes(5) SunOS 5.10 6 Dec 2001 logadm.conf(4)
All times are GMT -4. The time now is 06:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy