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
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWgawk | +--------------------+-----------------+ |Interface Stability | Volatile | +--------------------+-----------------+ NOTES
Source for gawk is available on http://opensolaris.org. Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 08:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy