03-29-2012
Perfect! Thanks.
Any ways to print without the -- between records?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
how can i print the previous, current and next line using sed?
current line is the matching line.
The following prints all lines containing 'Failure' and also the immediate next line
cat $file | sed -n -e '/Failure/{N;p;}'
Now, i also want to print the previous line too.
Thanks,... (8 Replies)
Discussion started by: ysrinu
8 Replies
2. Shell Programming and Scripting
Ok I have a file with hundreds of lines, four columns, space delimited, TESTB.TXT for example
TESTB.TXT
---
AA ZZ 12 34
BB YY 56 78
CC XX 91 23
DD VV 45 67
---
I want a new file that has 7 columns, the first four are identical, and the next 3 are the last three of the next line...so... (5 Replies)
Discussion started by: ajp7701
5 Replies
3. Shell Programming and Scripting
Hello,
Can anybody help me to correct my sed syntax to find the string and print previous two lines and current line and next one line.
i am using string as "testing"
netstat -v | sed -n -e '/test/{x;2!p;g;$!N;p;D;}' -e h
i am able to get the previous line current line next line but... (1 Reply)
Discussion started by: nmadhuhb
1 Replies
4. Shell Programming and Scripting
Hi
I am using korn shell is there a built in or ny other way to get the current line number so i can write the current line number to the logfile to aid in debugging like
logmsg $lineno $date
logmsg is a helper function that helps in logging messages to a log file
regards (3 Replies)
Discussion started by: xiamin
3 Replies
5. Shell Programming and Scripting
I generally use yy to copy a line and then p to paste the line at end of current line.
But is there a way to paste the copied line in concatenation with the current line with out going to next line. (3 Replies)
Discussion started by: paragkalra
3 Replies
6. Shell Programming and Scripting
Hi,
I want to print the line number with the pattern of the line on a same line using multi-patterns in sed.
But i don't know how to do it.
For example, I have a file
abc
def
ghi
I want to print
1 abc
2 def
3 ghi
I know how to write it one line code, but i don't know how to put... (11 Replies)
Discussion started by: ntpntp
11 Replies
7. Shell Programming and Scripting
I am trying to delete lines in archived Apache httpd logs
Each line has the pattern:
<ip-address> - - <date-time> <document-request-URL> <http-response> <size-of-req'd-doc> <referring-document-URL>
This pattern is shown in the example of 6 lines from the log in the code box below. These 6... (1 Reply)
Discussion started by: Proteomist
1 Replies
8. Shell Programming and Scripting
Hi all,
Let's say I have a script calling for the two variables PA_VALUE and PB_VALUE.
for pa in PA_VALUE
blah blah
do
for pb in PB_VALUE
blah blah
do
I have a text file with two columns of values for PA and PB.
14.5 16.7
7.8 9.5
5.6 3.6
etc etc
I would like to read this... (7 Replies)
Discussion started by: crimsonengineer
7 Replies
9. Shell Programming and Scripting
Hi,
I have an XML file and I am tring to extract some data form it, after lot of data cleaning process, I ended up with an issue, and need your urgent support.
my current input data in below format:
<Node>xxxxxx
<Node>yyyyy</Node>
<Node>zzzzzz
<Node>12345</node>
I need... (9 Replies)
Discussion started by: rramkrishnas
9 Replies
10. Shell Programming and Scripting
Hello All,
I am looking for help to achieve the following:
Here is the data set
1757890237|42|55570025|1468796400|0
1757890237|32|55570025|1471474800|0
1757890237|54|55570025|1474153200|1476745200
1757890237|34|55570026|1468796400|0
1757890237|44|55570026|1471474800|0... (7 Replies)
Discussion started by: angshuman
7 Replies
TRPT(8) BSD System Manager's Manual TRPT(8)
NAME
trpt -- transliterate protocol trace
SYNOPSIS
trpt [-a] [-f] [-j] [-p hex-address] [-s] [-t] [system [core]]
DESCRIPTION
The trpt utility interrogates the buffer of TCP trace records created when a socket is marked for ``debugging'' (see setsockopt(2)), and
prints a readable description of these records. When no options are supplied, trpt prints all the trace records found in the system grouped
according to TCP connection protocol control block (PCB).
The following options may be used to alter this behavior:
-a In addition to the normal output, print the values of the source and destination addresses for each packet recorded.
-f Follow the trace as it occurs, waiting a short time for additional records each time the end of the log is reached.
-j Just give a list of the protocol control block addresses for which there are trace records.
-p Show only trace records associated with the protocol control block at the given address hex-address.
-s In addition to the normal output, print a detailed description of the packet sequencing information.
-t In addition to the normal output, print the values for all timers at each point in the trace.
The recommended use of trpt is as follows. Isolate the problem and enable debugging on the socket(s) involved in the connection. Find the
address of the protocol control blocks associated with the sockets using the -A option to netstat(1). Then run trpt with the -p option, sup-
plying the associated protocol control block addresses. The -f option can be used to follow the trace log once the trace is located. If
there are many sockets using the debugging option, the -j option may be useful in checking to see if any trace records are present for the
socket in question.
If debugging is being performed on a system or core file other than the default, the last two arguments may be used to supplant the defaults.
FILES
/boot/kernel/kernel
/dev/kmem
DIAGNOSTICS
no namelist When the system image does not contain the proper symbols to find the trace buffer; others which should be self explanatory.
SEE ALSO
netstat(1), setsockopt(2)
HISTORY
The trpt utility appeared in 4.2BSD.
BUGS
Should also print the data for each input or output, but this is not saved in the trace record.
The output format is inscrutable and should be described here.
BSD
December 11, 1993 BSD